{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 11 数据分析案例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from datetime import datetime\n",
    "\n",
    "# 导入matplotlib库中的额pyplot\n",
    "import matplotlib.pyplot as plt\n",
    "# 让图表直接在Jupyter notebook中展示出来\n",
    "%matplotlib inline\n",
    "# 解决中文乱码问题\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']\n",
    "# 解决负号无法正常显示的问题\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "# 默认设置下matplotlib做出来的图标不是很清晰，可以将图表设置成矢量格式显示\n",
    "%config InlineBackend.figure_format = 'svg'\n",
    "\n",
    "# 一个cell输出多行语句\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 一、利用Python实现报表自动化\n",
    "数据分析师 vs \"表哥\"\n",
    "\n",
    "### 1.1 为什么要进行报表自动化\n",
    "* 提高工作效率\n",
    "* 减少错误\n",
    "\n",
    "### 1.2 什么样的报表适合自动化\n",
    "* 使用频率较高，如：日报、周报、月报\n",
    "* 开发时间长短\n",
    "* 需求变更频率高\n",
    "* 流程标准\n",
    "\n",
    "### 1.3 案例说明\n",
    "假如你现在每天需要做一个表，这个表包括销售额、客流量、客单价这个三个指标的本月累计、上月同期、去年同期、环比、同比这几个指标\n",
    "\n",
    "<img src='./image/case1_1.jpg' width='60%' />\n",
    "\n",
    "做报表的源数据存放在一张订单表里面，包含了从去年至今的所有订单数据\n",
    "\n",
    "<img src='./image/case1_2.jpg' width='60%' />\n",
    "\n",
    "指标说明：\n",
    "* 销售额 = 单价*销量\n",
    "* 客流量 = 订单ID去重计数\n",
    "* 客单价 = 销售额/客流量\n",
    "* 本月 = 2018年2月\n",
    "* 上月 = 2018年1月\n",
    "* 去年同期 = 2017年2月"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>商品ID</th>\n",
       "      <th>类别ID</th>\n",
       "      <th>门店编号</th>\n",
       "      <th>单价</th>\n",
       "      <th>销量</th>\n",
       "      <th>成交时间</th>\n",
       "      <th>订单ID</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>30006206.0</td>\n",
       "      <td>915000003.0</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>25.23</td>\n",
       "      <td>0.328</td>\n",
       "      <td>2018-01-01</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>30163281.0</td>\n",
       "      <td>914010000.0</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>2.00</td>\n",
       "      <td>2.000</td>\n",
       "      <td>2018-01-02</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>30200518.0</td>\n",
       "      <td>922000000.0</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>19.62</td>\n",
       "      <td>0.230</td>\n",
       "      <td>2018-01-03</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>29989105.0</td>\n",
       "      <td>922000000.0</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>2.80</td>\n",
       "      <td>2.044</td>\n",
       "      <td>2018-01-04</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>30179558.0</td>\n",
       "      <td>915000100.0</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>47.41</td>\n",
       "      <td>0.226</td>\n",
       "      <td>2018-01-05</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         商品ID         类别ID  门店编号     单价     销量       成交时间  \\\n",
       "0  30006206.0  915000003.0  CDNL  25.23  0.328 2018-01-01   \n",
       "1  30163281.0  914010000.0  CDNL   2.00  2.000 2018-01-02   \n",
       "2  30200518.0  922000000.0  CDNL  19.62  0.230 2018-01-03   \n",
       "3  29989105.0  922000000.0  CDNL   2.80  2.044 2018-01-04   \n",
       "4  30179558.0  915000100.0  CDNL  47.41  0.226 2018-01-05   \n",
       "\n",
       "                       订单ID  \n",
       "0  20170103CDLG000210052759  \n",
       "1  20170103CDLG000210052759  \n",
       "2  20170103CDLG000210052759  \n",
       "3  20170103CDLG000210052759  \n",
       "4  20170103CDLG000210052759  "
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 3744 entries, 0 to 3743\n",
      "Data columns (total 7 columns):\n",
      "商品ID    3478 non-null float64\n",
      "类别ID    3478 non-null float64\n",
      "门店编号    3478 non-null object\n",
      "单价      3478 non-null float64\n",
      "销量      3478 non-null float64\n",
      "成交时间    3478 non-null datetime64[ns]\n",
      "订单ID    3478 non-null object\n",
      "dtypes: datetime64[ns](1), float64(4), object(2)\n",
      "memory usage: 204.9+ KB\n"
     ]
    }
   ],
   "source": [
    "# parse_dates：将数据解析为时间格式\n",
    "data = pd.read_csv('./data/order-14.1.csv', parse_dates=['成交时间'], encoding='gbk')\n",
    "data.head()\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10412.78007"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "343"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "30.357959387755105"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算本月相关指标\n",
    "# 本月数据\n",
    "month_this = data[(data['成交时间'] >= datetime(2018, 2, 1)) & (data['成交时间'] <= datetime(2018, 2, 28))]\n",
    "# 本月销售额\n",
    "sales_this = (month_this['销量']*month_this['单价']).sum()\n",
    "# 客流量\n",
    "traffic_this = month_this['订单ID'].drop_duplicates().count()\n",
    "# 客单价计算\n",
    "s_t_this = sales_this/traffic_this\n",
    "sales_this\n",
    "traffic_this\n",
    "s_t_this"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9940.97291"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "315"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "31.55864415873016"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算上月相关指标\n",
    "month_pre = data[(data['成交时间'] >= datetime(2018, 1, 1)) & (data['成交时间'] <= datetime(2018, 1, 31))]\n",
    "sales_pre = (month_pre['销量']*month_pre['单价']).sum()\n",
    "# 客流量\n",
    "traffic_pre = month_pre['订单ID'].drop_duplicates().count()\n",
    "# 客单价计算\n",
    "s_t_pre = sales_pre/traffic_pre\n",
    "sales_pre\n",
    "traffic_pre\n",
    "s_t_pre"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>本月累计</th>\n",
       "      <th>上月同期</th>\n",
       "      <th>去年同期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>销售额</td>\n",
       "      <td>10412.780070</td>\n",
       "      <td>9940.972910</td>\n",
       "      <td>8596.313470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>客流量</td>\n",
       "      <td>315.000000</td>\n",
       "      <td>315.000000</td>\n",
       "      <td>262.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>客单价</td>\n",
       "      <td>31.558644</td>\n",
       "      <td>31.558644</td>\n",
       "      <td>32.810357</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             本月累计         上月同期         去年同期\n",
       "销售额  10412.780070  9940.972910  8596.313470\n",
       "客流量    315.000000   315.000000   262.000000\n",
       "客单价     31.558644    31.558644    32.810357"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_month_data(data):\n",
    "    # 本月销售额\n",
    "    sales = (data['销量']*data['单价']).sum()\n",
    "    # 客流量\n",
    "    traffic = data['订单ID'].drop_duplicates().count()\n",
    "    # 客单价计算\n",
    "    s_t = sales/traffic\n",
    "    return (sales, traffic, s_t)\n",
    "\n",
    "month_last_year = data[(data['成交时间'] >= datetime(2017, 2, 1)) & (data['成交时间'] <= datetime(2017, 2, 28))]\n",
    "sales_this, traffic_this, s_t_this = get_month_data(month_this)\n",
    "sales_pre, traffic_pre, s_t_pre = get_month_data(month_pre)\n",
    "sales_last_year, traffic_last_year, s_t_last_year = get_month_data(month_last_year)\n",
    "\n",
    "report = pd.DataFrame([[sales_this, sales_pre, sales_last_year], \n",
    "                       [traffic_pre, traffic_pre, traffic_last_year], \n",
    "                       [s_t_pre, s_t_pre, s_t_last_year]],\n",
    "                     columns=['本月累计', '上月同期', '去年同期'],\n",
    "                     index=['销售额', '客流量', '客单价'])\n",
    "report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>本月累计</th>\n",
       "      <th>上月同期</th>\n",
       "      <th>去年同期</th>\n",
       "      <th>环比</th>\n",
       "      <th>同比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>销售额</td>\n",
       "      <td>10412.780070</td>\n",
       "      <td>9940.972910</td>\n",
       "      <td>8596.313470</td>\n",
       "      <td>0.047461</td>\n",
       "      <td>0.211308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>客流量</td>\n",
       "      <td>315.000000</td>\n",
       "      <td>315.000000</td>\n",
       "      <td>262.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.202290</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>客单价</td>\n",
       "      <td>31.558644</td>\n",
       "      <td>31.558644</td>\n",
       "      <td>32.810357</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.038150</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             本月累计         上月同期         去年同期        环比        同比\n",
       "销售额  10412.780070  9940.972910  8596.313470  0.047461  0.211308\n",
       "客流量    315.000000   315.000000   262.000000  0.000000  0.202290\n",
       "客单价     31.558644    31.558644    32.810357  0.000000 -0.038150"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 添加同比与环比\n",
    "report['环比'] = report['本月累计'] / report['上月同期'] - 1\n",
    "report['同比'] = report['本月累计'] / report['去年同期'] - 1\n",
    "report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 导出结果\n",
    "report.to_excel('./data/order-report.xlsx', encoding='utf-8')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 二、自动发送邮件\n",
    "报表做出来后要发送给老板看，每天自动发送邮件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "send: 'ehlo pandeMacBook-Pro.local\\r\\n'\n",
      "reply: b'250-mail\\r\\n'\n",
      "reply: b'250-PIPELINING\\r\\n'\n",
      "reply: b'250-AUTH LOGIN PLAIN\\r\\n'\n",
      "reply: b'250-AUTH=LOGIN PLAIN\\r\\n'\n",
      "reply: b'250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFyN8wFUCa0xDrUUUUj\\r\\n'\n",
      "reply: b'250-STARTTLS\\r\\n'\n",
      "reply: b'250 8BITMIME\\r\\n'\n",
      "reply: retcode (250); Msg: b'mail\\nPIPELINING\\nAUTH LOGIN PLAIN\\nAUTH=LOGIN PLAIN\\ncoremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFyN8wFUCa0xDrUUUUj\\nSTARTTLS\\n8BITMIME'\n",
      "send: 'AUTH PLAIN AGxpdXBhbjY4ODhAMTYzLmNvbQBzaWxpYW4xODc4\\r\\n'\n",
      "reply: b'235 Authentication successful\\r\\n'\n",
      "reply: retcode (235); Msg: b'Authentication successful'\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(235, b'Authentication successful')"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "send: 'mail FROM:<liupan6888@163.com>\\r\\n'\n",
      "reply: b'250 Mail OK\\r\\n'\n",
      "reply: retcode (250); Msg: b'Mail OK'\n",
      "send: 'rcpt TO:<liupan6888@163.com>\\r\\n'\n",
      "reply: b'250 Mail OK\\r\\n'\n",
      "reply: retcode (250); Msg: b'Mail OK'\n",
      "send: 'rcpt TO:<liupan6888@163.com>\\r\\n'\n",
      "reply: b'250 Mail OK\\r\\n'\n",
      "reply: retcode (250); Msg: b'Mail OK'\n",
      "send: 'data\\r\\n'\n",
      "reply: b'354 End data with <CR><LF>.<CR><LF>\\r\\n'\n",
      "reply: retcode (354); Msg: b'End data with <CR><LF>.<CR><LF>'\n",
      "data: (354, b'End data with <CR><LF>.<CR><LF>')\n",
      "send: b'Content-Type: multipart/mixed; boundary=\"===============7283546143277177108==\"\\r\\nMIME-Version: 1.0\\r\\nSubject: =?utf-8?b?6L+Z5piv5LiA5Lu95rWL6K+V6YKu5Lu2?=\\r\\nto: liupan6888@163.com\\r\\nCc: liupan6888@163.com\\r\\nfrom: =?utf-8?b?5byg5LiJ?=\\r\\n\\r\\n--===============7283546143277177108==\\r\\nContent-Type: text/plain; charset=\"utf-8\"\\r\\nMIME-Version: 1.0\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\n5oKo5aW977yM6L+Z5piv5LiA5Lu95rWL6K+V6YKu5Lu2\\r\\n\\r\\n--===============7283546143277177108==\\r\\nContent-Type: application/octet-stream\\r\\nMIME-Version: 1.0\\r\\nContent-Transfer-Encoding: base64\\r\\nContent-Disposition: attachment; filename*=utf-8\\'\\'%E8%AE%A2%E5%8D%95%E9%94%80%E5%94%AE%E5%88%86%E6%9E%90%E6%8A%A5%E5%91%8A.xlsx\\r\\n\\r\\nUEsDBBQAAAAIAAAAPwBhXUk6TwEAAI8EAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbK2Uy27CMBBF\\r\\n9/2KyNsqMXRRVRWBRR/LFqn0A1x7Qiwc2/IMFP6+k/BQW1Gggk2sZO7cc8eOPBgtG5ctIKENvhT9\\r\\noicy8DoY66eleJ8853ciQ1LeKBc8lGIFKEbDq8FkFQEzbvZYipoo3kuJuoZGYREieK5UITWK+DVN\\r\\nZVR6pqYgb3q9W6mDJ/CUU+shhoNHqNTcUfa05M/rIAkciuxhLWxZpVAxOqsVcV0uvPlFyTeEgjs7\\r\\nDdY24jULhNxLaCt/AzZ9r7wzyRrIxirRi2pYJU3Q4xQiStYXh132xAxVZTWwx7zhlgLaQAZMHtkS\\r\\nElnYZT7I1iHB/+HbPWq7TyQunURaOcCzR8WYQBmsAahxxdr0CJn4f4L1s382v7M5AvwMafYRwuzS\\r\\nw7Zr0SjrT+B3YpTdcv7UP4Ps/I8dea0SmDdKfA1c/OS/e29zyO4+GX4BUEsDBBQAAAAIAAAAPwDy\\r\\nn0na6QAAAEsCAAALAAAAX3JlbHMvLnJlbHOtksFOwzAMQO98ReT7mm5ICKGluyCk3SY0PsAkbhu1\\r\\njaPEg+7viZBADI1pB45x7Odny+vNPI3qjVL2HAwsqxoUBcvOh87Ay/5pcQ8qCwaHIwcycKQMm+Zm\\r\\n/UwjSqnJvY9ZFUjIBnqR+KB1tj1NmCuOFMpPy2lCKc/U6Yh2wI70qq7vdPrJgOaEqbbOQNq6Jaj9\\r\\nMdI1bG5bb+mR7WGiIGda/MooZEwdiYF51O+chlfmoSpQ0OddVte7/D2nnkjQoaC2nGgRU6lO4sta\\r\\nv3Uc210J58+MS0K3/7kcmoWCI3dZCWP8MtInN9B8AFBLAwQUAAAACAAAAD8ARHVb8OgAAAC5AgAA\\r\\nGgAAAHhsL19yZWxzL3dvcmtib29rLnhtbC5yZWxzrZLBasMwEETv/Qqx91p2EkopkXMphVzb9AOE\\r\\ntLZMbElot2n99xEJTR0IoQefxIzYmQe7683P0IsDJuqCV1AVJQj0JtjOtwo+d2+PzyCItbe6Dx4V\\r\\njEiwqR/W79hrzjPkukgih3hS4Jjji5RkHA6aihDR558mpEFzlqmVUZu9blEuyvJJpmkG1FeZYmsV\\r\\npK2tQOzGiP/JDk3TGXwN5mtAzzcq5HdIe3KInEN1apEVXCySp6cqcirI2zCLOWE4z+IfyEmezbsM\\r\\nyzkZiMc+L/QCcdb36lez1jud0H5wytc2pZjavzDy6uLqI1BLAwQUAAAACAAAAD8AFhn30hkCAABC\\r\\nBQAAGAAAAHhsL3dvcmtzaGVldHMvc2hlZXQxLnhtbI2Uy46bMBSG930K5P2A74aIMJokE7WLSlVv\\r\\newdMggYwsj2T9u1rIIkmQKVhZZ/zn8t3jJ0+/mnq4E0ZW+l2DVAIQaDaXBdVe1yDXz/3DzEIrJNt\\r\\nIWvdqjX4qyx4zD6lZ21e7EkpF/gErV2Dk3PdKopsflKNtKHuVOs9pTaNdH5rjpHtjJLFENTUEYaQ\\r\\nR42sWjBmWJmP5NBlWeVqp/PXRrVuTGJULZ1v356qzoIsLSrv63kCo8o1eEKrPQVRlg6Vf1fqbN+t\\r\\nAycPP1StcqcKzw+CHuyg9Uvv/OJNsA+NZrH7oalvJihUKV9r912fP6vqeHI+CbtV20kns9Toc2CG\\r\\n5LaT/azQivs+89646a2Dz0f23b9lMI3efMn8otjOFehesZsr8L3iea4g94r9XEFvisgT3DDwEsYT\\r\\nnoWz+wIbPLYOKcKhiCEUE8zRnyQUhonAyZRxdMcs4SFBhAo4fBPV86iCIaSCchhzwrlAiHE+ob3q\\r\\nMEIECo55wlmMYrKMTBaRyQx5UmVDxkmjySi2/7HvRjvm09MjS//FnlwZIMaJnycnhMVCJMsMdJGB\\r\\nzhgmx7Khl15DxmJOKfIlCEQT0u2HVLuLCocxgoRxwZjADCUTWrpIO1of/NGSGNEkwYRChCgieMIb\\r\\nvbt5nTyqr9Icq9YGtSo9JAwFCMx4UYe1092wYiA4aOd0c92d/GOlTL/zB11q7a6b/j24PX/ZP1BL\\r\\nAwQUAAAACAAAAD8AgxhqJUgBAAAmAgAADwAAAHhsL3dvcmtib29rLnhtbI1Ry07DMBC88xXW3mke\\r\\naiNaNanES1RCgERpzybeNFYdO7Id0v4961QpcOO0M+Pd0c56uTo2in2hddLoHJJJDAx1aYTU+xw+\\r\\nNo/XN8Cc51pwZTTmcEIHq+Jq2Rt7+DTmwGheuxxq79tFFLmyxoa7iWlR00tlbMM9UbuPXGuRC1cj\\r\\n+kZFaRxnUcOlhrPDwv7Hw1SVLPHelF2D2p9NLCruaXtXy9ZBsaykwu05EONt+8IbWvuogCnu/IOQ\\r\\nHkUOU6Kmxz+C7drbTqpAZvEMouIS8s0ygRXvlN/QaqM7nSudpmkWOkPXVmLvfoYCZced1ML0OaRT\\r\\nuuxpZMkMWD/gnRS+JiGL5xftCeW+9jnMsywO5tEv9+F+Y2V6CPcecEL/FOqa9idsF5KAXYtkcBjH\\r\\nSq5KShPK0JhOZ8kcWNUpdUfaq342fDAIQ2OS4htQSwMEFAAAAAgAAAA/ABtSgNzyAAAAagEAABQA\\r\\nAAB4bC9zaGFyZWRTdHJpbmdzLnhtbG3QwUrEMBAG4LtPEXJ30/UgIkn2IPgE+gChjdtAm9ROKnrT\\r\\nkyK6eqi3irhnaS8rq+zrbLPbtzAiItg9/v83w8DQ0XmaoDOZgzKa4eEgwEjq0ERKjxk+Pjrc3sMI\\r\\nrNCRSIyWDF9IwCO+RQEs8qsaGI6tzfYJgTCWqYCByaT2cmLyVFgf8zGBLJciglhKmyZkJwh2SSqU\\r\\nxig0hbYM+xuFVqeFPPjNnILi1HJXvbnqZjVr1vUrJZZT8t3/2PLj1lv7eOeql//WThbt52yzrSaN\\r\\na8rehp/tt1152ZZ1N33ujddT937VXT9sgPb+abmY/wHxz+JfUEsDBBQAAAAIAAAAPwBproQY+wEA\\r\\nAD0FAAANAAAAeGwvc3R5bGVzLnhtbL1U34ucMBB+718R8n7nKvRoi3r0CguFthRuC32NGjWQH5KM\\r\\ni95f30niqgt3LNxDX8zM5JtvZr7E5I+TkuTMrRNGFzS9P1DCdW0aobuC/jkd7z5R4oDphkmjeUFn\\r\\n7uhj+SF3MEv+3HMOBBm0K2gPMHxJElf3XDF3bwaucac1VjFA13aJGyxnjfNJSibZ4fCQKCY0LfPW\\r\\naHCkNqOGgmZLoMzdCzkziW2lNCnz2khjCSA99hEimikeEd+YFJUVPtgyJeQcw5kPhI4WnBLaWB9M\\r\\nYoX4rZL/USssDpOElNfDYqDMBwbArT6iQxb7NA9YXqPwkSbgbqA7y+Y0+7hLCAvWrYxt8KD3lWOo\\r\\nzCVvAROs6Hq/ghkSvwlgFBqNYJ3RTHrKS8Y+k4TLUFDow2FG7dgIZpEu8aCF/SY2oEILN6GIuXR5\\r\\nExthr8+yGChRzaV89kx/21WnFPmmluhRHRV8bwqKv4g/yYuJ4i5mpImO59+zRe4dbfYuWjK1K/9b\\r\\n2ekb2emWTdgwyPlo4nzRewrAzf8qRacVv0jALi7pjRUvmOrveI0Bbql/QUDUPoKHEoaf2kWBdfgg\\r\\nxZWsa5T4v6ugv/xjIXdtVqOQIPQrkiJnM21qhl1gFb5JV1WQo+EtGyWc1s2CbvZP3ohRfV5Rv8XZ\\r\\nwILa7B/+TqYPoYPt4Sv/AVBLAwQUAAAACAAAAD8AGPpGVLAFAABSGwAAEwAAAHhsL3RoZW1lL3Ro\\r\\nZW1lMS54bWztWU2P20QYvvMrRr63jhM7za6arTbZpIXttqvdtKjHiT2xpxl7rJnJbnND7REJCVEQ\\r\\nFyRuHBBQqZW4lF+zUARF6l/g9UeS8WayzbaLALU5JJ7x835/+B3n6rUHMUNHREjKk7blXK5ZiCQ+\\r\\nD2gStq07g/6lloWkwkmAGU9I25oSaV3b+uAq3lQRiQkC8kRu4rYVKZVu2rb0YRvLyzwlCdwbcRFj\\r\\nBUsR2oHAx8A2Zna9VmvaMaaJhRIcA9fboxH1CRpkLK2tGfMeg69EyWzDZ+LQzyXqFDk2GDvZj5zK\\r\\nLhPoCLO2BXICfjwgD5SFGJYKbrStWv6x7K2r9pyIqRW0Gl0//5R0JUEwrud0IhzOCZ2+u3FlZ86/\\r\\nXvBfxvV6vW7PmfPLAdj3wVJnCev2W05nxlMDFZfLvLs1r+ZW8Rr/xhJ+o9PpeBsVfGOBd5fwrVrT\\r\\n3a5X8O4C7y3r39nudpsVvLfAN5fw/SsbTbeKz0ERo8l4CZ3Fcx6ZOWTE2Q0jvAXw1iwBFihby66C\\r\\nPlGrci3G97noAyAPLlY0QWqakhH2AdfF8VBQnAnAmwRrd4otXy5tZbKQ9AVNVdv6KMVQEQvIq+c/\\r\\nvHr+FL16/uTk4bOThz+fPHp08vAnA+ENnIQ64cvvPv/rm0/Qn0+/ffn4SzNe6vjffvz011++MAOV\\r\\nDnzx1ZPfnz158fVnf3z/2ADfFniowwc0JhLdIsfogMdgm0EAGYrzUQwiTCsUOAKkAdhTUQV4a4qZ\\r\\nCdchVefdFdAATMDrk/sVXQ8jMVHUANyN4gpwj3PW4cJozm4mSzdnkoRm4WKi4w4wPjLJ7p4KbW+S\\r\\nQiZTE8tuRCpq7jOINg5JQhTK7vExIQaye5RW/LpHfcElHyl0j6IOpkaXDOhQmYlu0BjiMjUpCKGu\\r\\n+GbvLupwZmK/Q46qSCgIzEwsCau48TqeKBwbNcYx05E3sYpMSh5OhV9xuFQQ6ZAwjnoBkdJEc1tM\\r\\nK+ruYuhExrDvsWlcRQpFxybkTcy5jtzh426E49SoM00iHfuhHEOKYrTPlVEJXq2QbA1xwMnKcN+l\\r\\nRJ2vrO/QMDInSHZnIsquXem/MU3OasaMQjd+34xn8G14NJlK4nQLXoX7HzbeHTxJ9gnk+vu++77v\\r\\nvot9d1Utr9ttFw3W1ufinF+8ckgeUcYO1ZSRmzJvzRKUDvqwmS9yovlMnkZwWYqr4EKB82skuPqY\\r\\nqugwwimIcXIJoSxZhxKlXMJJwFrJOz9OUjA+3/NmZ0BAY7XHg2K7oZ8N52zyVSh1QY2MwbrCGlfe\\r\\nTphTANeU5nhmad6Z0mzNm1ANCGcHf6dZL0RDxmBGgszvBYNZWC48RDLCASlj5BgNcRpruq31eq9p\\r\\n0jYabydtnSDp4twV4rwLiFJtKUr2cjmypLpCx6CVV/cs5OO0bY1gkoLLOAV+MmtAmIVJ2/JVacpr\\r\\ni/m0wea0dGorDa6ISIVUO1hGBVV+a/bqJFnoX/fczA8XY4ChG62nRaPl/Ita2KdDS0Yj4qsVO4tl\\r\\neY9PFBGHUXCMhmwiDjDo7RbZFVAJz4z6bCGgQt0y8aqVX1bB6Vc0ZXVglka47EktLfYFPL+e65Cv\\r\\nNPXsFbq/oSmNCzTFe3dNyTIXxtZGkB+oYAwQGGU52ra4UBGHLpRG1O8LGBxyWaAXgrLIVEIse9+c\\r\\n6UqOFn2r4FE0uTBSBzREgkKnU5EgZF+Vdr6GmVPXn68zRmWfmasr0+J3SI4IG2TV28zst1A06yal\\r\\nI3Lc6aDZpuoahv3/8OTjrph8zh4PFoLc88wirtb0tUfBxtupcM5Hbd1scd1b+1GbwuEDZV/QuKnw\\r\\n2WK+HfADiD6aT5QIEvFSqyy/+eYQdG5pxmWs/tkxahGC1op4X+TwqTm7scLZZ4t7c2d7Bl97Z7va\\r\\nXi5RWzvI5KulP5748D7I3oGD0oQpWbxNegBHze7sLwPgYy9It/4GUEsDBBQAAAAIAAAAPwAxx00r\\r\\nJQEAAFACAAARAAAAZG9jUHJvcHMvY29yZS54bWydks1qwzAQhO99CqO7LdmhJRW2A23JqYFCU1py\\r\\nE9ImEbV+kNQ6fvvKTuIk4FOPq5n9dnZRuTioJvkF56XRFcozghLQ3AipdxX6WC/TOUp8YFqwxmio\\r\\nUAceLeq7klvKjYM3Zyy4IMEnEaQ95bZC+xAsxdjzPSjms+jQUdwap1iIpdthy/g32wEuCHnACgIT\\r\\nLDDcA1M7EtEJKfiItD+uGQCCY2hAgQ4e51mOL94ATvnJhkG5cioZOguT1rM4ug9ejsa2bbN2Nlhj\\r\\n/hx/rV7fh1VTqftTcUB1KTjlDlgwri7xdREP1zAfVvHEWwniqYv6xNtpkWMfiCQGoMe4Z+Vz9vyy\\r\\nXqK6IAVJySzNyZoQej+nxeOmH3nTfwGq05B/E8+AY+7bT1D/AVBLAwQUAAAACAAAAD8AXrqn03cB\\r\\nAAAQAwAAEAAAAGRvY1Byb3BzL2FwcC54bWydksFO6zAQRfd8ReQ9dVIh9FQ5RqiAWPBEpRZYG2fS\\r\\nWDi25Rmilq/HSdWQAiuyujNzdX0ytrjatTbrIKLxrmTFLGcZOO0r47Yle9rcnf9jGZJylbLeQcn2\\r\\ngOxKnolV9AEiGcAsJTgsWUMUFpyjbqBVOEtjlya1j62iVMYt93VtNNx4/d6CIz7P80sOOwJXQXUe\\r\\nxkB2SFx09NfQyuueD583+5DypLgOwRqtKP2k/G909Ohrym53Gqzg06FIQWvQ79HQXuaCT0ux1srC\\r\\nMgXLWlkEwb8a4h5Uv7OVMhGl6GjRgSYfMzQfaWtzlr0qhB6nZJ2KRjliB9uhGLQNSFG++PiGDQCh\\r\\n4GNzkFPvVJsLWQyGJE6NfARJ+hRxY8gCPtYrFekX4mJKPDCwCeO65yt+8B1P+pa99G1QLi2Qj+rB\\r\\nuDd8Cht/owiO6zxtinWjIlTpBsZ1jw1xn7ii7f3LRrktVEfPz0F/+c+HBy6L+SxP33Dnx57gX29Z\\r\\nfgJQSwECFAMUAAAACAAAAD8AYV1JOk8BAACPBAAAEwAAAAAAAAAAAAAAgIEAAAAAW0NvbnRlbnRf\\r\\nVHlwZXNdLnhtbFBLAQIUAxQAAAAIAAAAPwDyn0na6QAAAEsCAAALAAAAAAAAAAAAAACAgYABAABf\\r\\ncmVscy8ucmVsc1BLAQIUAxQAAAAIAAAAPwBEdVvw6AAAALkCAAAaAAAAAAAAAAAAAACAgZICAAB4\\r\\nbC9fcmVscy93b3JrYm9vay54bWwucmVsc1BLAQIUAxQAAAAIAAAAPwAWGffSGQIAAEIFAAAYAAAA\\r\\nAAAAAAAAAACAgbIDAAB4bC93b3Jrc2hlZXRzL3NoZWV0MS54bWxQSwECFAMUAAAACAAAAD8Agxhq\\r\\nJUgBAAAmAgAADwAAAAAAAAAAAAAAgIEBBgAAeGwvd29ya2Jvb2sueG1sUEsBAhQDFAAAAAgAAAA/\\r\\nABtSgNzyAAAAagEAABQAAAAAAAAAAAAAAICBdgcAAHhsL3NoYXJlZFN0cmluZ3MueG1sUEsBAhQD\\r\\nFAAAAAgAAAA/AGmuhBj7AQAAPQUAAA0AAAAAAAAAAAAAAICBmggAAHhsL3N0eWxlcy54bWxQSwEC\\r\\nFAMUAAAACAAAAD8AGPpGVLAFAABSGwAAEwAAAAAAAAAAAAAAgIHACgAAeGwvdGhlbWUvdGhlbWUx\\r\\nLnhtbFBLAQIUAxQAAAAIAAAAPwAxx00rJQEAAFACAAARAAAAAAAAAAAAAACAgaEQAABkb2NQcm9w\\r\\ncy9jb3JlLnhtbFBLAQIUAxQAAAAIAAAAPwBeuqfTdwEAABADAAAQAAAAAAAAAAAAAACAgfURAABk\\r\\nb2NQcm9wcy9hcHAueG1sUEsFBgAAAAAKAAoAgAIAAJoTAAAAAA==\\r\\n\\r\\n--===============7283546143277177108==--\\r\\n.\\r\\n'\n",
      "reply: b'250 Mail OK queued as smtp14,EsCowAAHguk15mZeFZbJAw--.12455S2 1583801910\\r\\n'\n",
      "reply: retcode (250); Msg: b'Mail OK queued as smtp14,EsCowAAHguk15mZeFZbJAw--.12455S2 1583801910'\n",
      "data: (250, b'Mail OK queued as smtp14,EsCowAAHguk15mZeFZbJAw--.12455S2 1583801910')\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{}"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "send: 'quit\\r\\n'\n",
      "reply: b'221 Bye\\r\\n'\n",
      "reply: retcode (221); Msg: b'Bye'\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(221, b'Bye')"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import smtplib\n",
    "from email import encoders\n",
    "from email.header import Header\n",
    "from email.mime.text import MIMEText\n",
    "from email.utils import parseaddr, formataddr\n",
    "from email.mime.application import MIMEApplication\n",
    "from email.mime.multipart import MIMEMultipart\n",
    "\n",
    "# 发件人邮箱\n",
    "asender = 'liupan6888@163.com'\n",
    "# 收件人邮箱\n",
    "areceiver = 'liupan6888@163.com'\n",
    "# 抄送人邮箱\n",
    "acc = 'liupan6888@163.com'\n",
    "# 邮件主题\n",
    "asubject = '这是一份测试邮件'\n",
    "\n",
    "# 发件人地址\n",
    "from_addr = 'liupan6888@163.com'\n",
    "# 密码\n",
    "password = 'silian1878'\n",
    "\n",
    "# 邮件设置\n",
    "msg = MIMEMultipart()\n",
    "msg['Subject'] = asubject\n",
    "msg['to'] = areceiver\n",
    "msg['Cc'] = acc\n",
    "msg['from'] = '张三'\n",
    "\n",
    "# 正文\n",
    "body = '您好，这是一份测试邮件'\n",
    "\n",
    "# 添加邮件正文\n",
    "msg.attach(MIMEText(body, 'plain', 'utf-8'))\n",
    "\n",
    "# 添加附件\n",
    "xlsxpart = MIMEApplication(open('./data/order-report.xlsx', 'rb').read())\n",
    "xlsxpart.add_header('Content-Disposition', 'attachment', filename='订单销售分析报告.xlsx')\n",
    "msg.attach(xlsxpart)\n",
    "\n",
    "# 设置邮箱服务器地址及端口\n",
    "smtp_server = 'smtp.163.com'\n",
    "server = smtplib.SMTP(smtp_server, 25)\n",
    "server.set_debuglevel(1)\n",
    "# 登录邮箱\n",
    "server.login(from_addr, password)\n",
    "# 发送邮件\n",
    "server.sendmail(from_addr, areceiver.split(',')+acc.split(','),\n",
    "               msg.as_string())\n",
    "\n",
    "server.quit()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 三、假如你是某连锁超市的数据分析师\n",
    "### 3.1 哪些类别的商品比较畅销"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>商品ID</th>\n",
       "      <th>类别ID</th>\n",
       "      <th>门店编号</th>\n",
       "      <th>单价</th>\n",
       "      <th>销量</th>\n",
       "      <th>成交时间</th>\n",
       "      <th>订单ID</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>30006206</td>\n",
       "      <td>915000003</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>25.23</td>\n",
       "      <td>0.328</td>\n",
       "      <td>2017-01-03 09:56:00</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>30163281</td>\n",
       "      <td>914010000</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>2.00</td>\n",
       "      <td>2.000</td>\n",
       "      <td>2017-01-03 09:56:00</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>30200518</td>\n",
       "      <td>922000000</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>19.62</td>\n",
       "      <td>0.230</td>\n",
       "      <td>2017-01-03 09:56:00</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>29989105</td>\n",
       "      <td>922000000</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>2.80</td>\n",
       "      <td>2.044</td>\n",
       "      <td>2017-01-03 09:56:00</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>30179558</td>\n",
       "      <td>915000100</td>\n",
       "      <td>CDNL</td>\n",
       "      <td>47.41</td>\n",
       "      <td>0.226</td>\n",
       "      <td>2017-01-03 09:56:00</td>\n",
       "      <td>20170103CDLG000210052759</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       商品ID       类别ID  门店编号     单价     销量                成交时间  \\\n",
       "0  30006206  915000003  CDNL  25.23  0.328 2017-01-03 09:56:00   \n",
       "1  30163281  914010000  CDNL   2.00  2.000 2017-01-03 09:56:00   \n",
       "2  30200518  922000000  CDNL  19.62  0.230 2017-01-03 09:56:00   \n",
       "3  29989105  922000000  CDNL   2.80  2.044 2017-01-03 09:56:00   \n",
       "4  30179558  915000100  CDNL  47.41  0.226 2017-01-03 09:56:00   \n",
       "\n",
       "                       订单ID  \n",
       "0  20170103CDLG000210052759  \n",
       "1  20170103CDLG000210052759  \n",
       "2  20170103CDLG000210052759  \n",
       "3  20170103CDLG000210052759  \n",
       "4  20170103CDLG000210052759  "
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 3478 entries, 0 to 3477\n",
      "Data columns (total 7 columns):\n",
      "商品ID    3478 non-null int64\n",
      "类别ID    3478 non-null int64\n",
      "门店编号    3478 non-null object\n",
      "单价      3478 non-null float64\n",
      "销量      3478 non-null float64\n",
      "成交时间    3478 non-null datetime64[ns]\n",
      "订单ID    3478 non-null object\n",
      "dtypes: datetime64[ns](1), float64(2), int64(2), object(2)\n",
      "memory usage: 190.3+ KB\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>类别ID</th>\n",
       "      <th>销量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>240</td>\n",
       "      <td>922000003</td>\n",
       "      <td>425.328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>239</td>\n",
       "      <td>922000002</td>\n",
       "      <td>206.424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>251</td>\n",
       "      <td>923000006</td>\n",
       "      <td>190.294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>216</td>\n",
       "      <td>915030104</td>\n",
       "      <td>175.059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>238</td>\n",
       "      <td>922000001</td>\n",
       "      <td>121.355</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>218</td>\n",
       "      <td>915030204</td>\n",
       "      <td>0.215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>111</td>\n",
       "      <td>912060605</td>\n",
       "      <td>0.193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>201</td>\n",
       "      <td>915000102</td>\n",
       "      <td>0.110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>304</td>\n",
       "      <td>931000200</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>169</td>\n",
       "      <td>914050100</td>\n",
       "      <td>-1.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          类别ID       销量\n",
       "240  922000003  425.328\n",
       "239  922000002  206.424\n",
       "251  923000006  190.294\n",
       "216  915030104  175.059\n",
       "238  922000001  121.355\n",
       "..         ...      ...\n",
       "218  915030204    0.215\n",
       "111  912060605    0.193\n",
       "201  915000102    0.110\n",
       "304  931000200    0.000\n",
       "169  914050100   -1.000\n",
       "\n",
       "[368 rows x 2 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>类别ID</th>\n",
       "      <th>销量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>922000003</td>\n",
       "      <td>425.328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>922000002</td>\n",
       "      <td>206.424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>923000006</td>\n",
       "      <td>190.294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>915030104</td>\n",
       "      <td>175.059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>922000001</td>\n",
       "      <td>121.355</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>363</td>\n",
       "      <td>915030204</td>\n",
       "      <td>0.215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>364</td>\n",
       "      <td>912060605</td>\n",
       "      <td>0.193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>365</td>\n",
       "      <td>915000102</td>\n",
       "      <td>0.110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>366</td>\n",
       "      <td>931000200</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>367</td>\n",
       "      <td>914050100</td>\n",
       "      <td>-1.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>368 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          类别ID       销量\n",
       "0    922000003  425.328\n",
       "1    922000002  206.424\n",
       "2    923000006  190.294\n",
       "3    915030104  175.059\n",
       "4    922000001  121.355\n",
       "..         ...      ...\n",
       "363  915030204    0.215\n",
       "364  912060605    0.193\n",
       "365  915000102    0.110\n",
       "366  931000200    0.000\n",
       "367  914050100   -1.000\n",
       "\n",
       "[368 rows x 2 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv('./data/order-14.3.csv', parse_dates=['成交时间'], encoding='gbk')\n",
    "data.head()\n",
    "data.info()\n",
    "# 数据分组\n",
    "data.groupby('类别ID')['销量'].sum().reset_index().sort_values(by='销量', ascending=False)\n",
    "data.groupby('类别ID')['销量'].sum().sort_values(ascending=False).reset_index()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 哪些商品比较畅销"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销量</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>商品ID</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>29989059</td>\n",
       "      <td>391.549</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>29989072</td>\n",
       "      <td>102.876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30022232</td>\n",
       "      <td>101.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30031960</td>\n",
       "      <td>99.998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>29989157</td>\n",
       "      <td>72.453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30214826</td>\n",
       "      <td>0.073</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30179536</td>\n",
       "      <td>0.040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30156418</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30063823</td>\n",
       "      <td>-1.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30201941</td>\n",
       "      <td>-3.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1069 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               销量\n",
       "商品ID             \n",
       "29989059  391.549\n",
       "29989072  102.876\n",
       "30022232  101.000\n",
       "30031960   99.998\n",
       "29989157   72.453\n",
       "...           ...\n",
       "30214826    0.073\n",
       "30179536    0.040\n",
       "30156418    0.000\n",
       "30063823   -1.000\n",
       "30201941   -3.000\n",
       "\n",
       "[1069 rows x 1 columns]"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据透视表\n",
    "pd.pivot_table(data, index='商品ID', values='销量', aggfunc='sum').sort_values(by='销量', ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.3 不同门店的销售额占比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "门店编号\n",
       "CDLG    10908.82612\n",
       "CDNL     8059.47867\n",
       "CDXL     9981.76166\n",
       "Name: 销售额, dtype: float64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "门店编号\n",
       "CDLG    0.376815\n",
       "CDNL    0.278392\n",
       "CDXL    0.344792\n",
       "Name: 销售额, dtype: float64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x11f6aaf90>"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "([<matplotlib.patches.Wedge at 0x11efccdd0>,\n",
       "  <matplotlib.patches.Wedge at 0x11efdd4d0>,\n",
       "  <matplotlib.patches.Wedge at 0x11efdddd0>],\n",
       " [Text(0.41514948122654655, 1.0186515146198574, 'CDLG'),\n",
       "  Text(-1.0944381861745864, -0.11047649814726032, 'CDNL'),\n",
       "  Text(0.5153568158113694, -0.971806231919083, 'CDXL')],\n",
       " [Text(0.22644517157811628, 0.5556280988835585, '38%'),\n",
       "  Text(-0.5969662833679561, -0.060259908080323804, '28%'),\n",
       "  Text(0.28110371771529236, -0.530076126501318, '34%')])"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, '不同门店的销售额占比')"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"247.543125pt\" version=\"1.1\" viewBox=\"0 0 238.309856 247.543125\" width=\"238.309856pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 247.543125 \n",
       "L 238.309856 247.543125 \n",
       "L 238.309856 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 209.365856 131.623125 \n",
       "C 209.365856 114.338513 204.213437 97.440032 194.569682 83.095841 \n",
       "C 184.925926 68.751651 171.221708 57.602637 155.215348 51.079276 \n",
       "C 139.208987 44.555914 121.615635 42.949662 104.692607 46.466611 \n",
       "C 87.769578 49.983559 72.27298 58.466573 60.191103 70.827239 \n",
       "L 122.389856 131.623125 \n",
       "L 209.365856 131.623125 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 60.191103 70.827239 \n",
       "C 51.29398 79.929663 44.502495 90.875162 40.29741 102.888912 \n",
       "C 36.092326 114.902662 34.575267 127.694329 35.853623 140.358401 \n",
       "C 37.13198 153.022473 41.174859 165.252901 47.696068 176.1839 \n",
       "C 54.217277 187.114899 63.05922 196.482305 73.595981 203.623003 \n",
       "L 122.389856 131.623125 \n",
       "L 60.191103 70.827239 \n",
       "z\n",
       "\" style=\"fill:#ff7f0e;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 73.595981 203.623003 \n",
       "C 86.67323 212.485374 101.921168 217.619715 117.695484 218.472348 \n",
       "C 133.469801 219.32498 149.182327 215.864113 163.138651 208.46296 \n",
       "C 177.094974 201.061807 188.774714 189.996331 196.918346 176.459814 \n",
       "C 205.061978 162.923297 209.365856 147.420468 209.365856 131.623125 \n",
       "L 122.389856 131.623125 \n",
       "L 73.595981 203.623003 \n",
       "z\n",
       "\" style=\"fill:#2ca02c;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\"/>\n",
       "   <g id=\"matplotlib.axis_2\"/>\n",
       "   <g id=\"text_1\">\n",
       "    <!-- CDLG -->\n",
       "    <defs>\n",
       "     <path d=\"M 46.484375 28.515625 \n",
       "Q 46.09375 13.671875 40.234375 7.421875 \n",
       "Q 34.375 1.171875 26.171875 1.171875 \n",
       "Q 16.796875 1.171875 10.15625 8.78125 \n",
       "Q 3.515625 16.40625 3.515625 33.203125 \n",
       "Q 3.515625 51.5625 9.953125 60.546875 \n",
       "Q 16.40625 69.53125 26.5625 69.53125 \n",
       "Q 35.15625 69.53125 40.8125 63.078125 \n",
       "Q 46.484375 56.640625 46.09375 44.921875 \n",
       "L 37.5 44.921875 \n",
       "Q 37.5 53.515625 34.765625 57.8125 \n",
       "Q 32.03125 62.109375 26.5625 62.109375 \n",
       "Q 20.3125 62.109375 16.59375 55.65625 \n",
       "Q 12.890625 49.21875 12.890625 33.984375 \n",
       "Q 12.890625 19.921875 16.59375 14.25 \n",
       "Q 20.3125 8.59375 26.171875 8.59375 \n",
       "Q 30.46875 8.59375 33.984375 12.6875 \n",
       "Q 37.5 16.796875 37.5 28.515625 \n",
       "z\n",
       "\" id=\"SimHei-67\"/>\n",
       "     <path d=\"M 45.703125 35.15625 \n",
       "Q 45.703125 17.1875 38.078125 9.5625 \n",
       "Q 30.46875 1.953125 17.578125 1.953125 \n",
       "L 4.296875 1.953125 \n",
       "L 4.296875 68.75 \n",
       "L 17.578125 68.75 \n",
       "Q 32.03125 68.75 38.859375 60.9375 \n",
       "Q 45.703125 53.125 45.703125 35.15625 \n",
       "z\n",
       "M 36.328125 35.15625 \n",
       "Q 36.328125 49.609375 31.640625 55.46875 \n",
       "Q 26.953125 61.328125 17.578125 61.328125 \n",
       "L 13.28125 61.328125 \n",
       "L 13.28125 9.375 \n",
       "L 17.578125 9.375 \n",
       "Q 26.953125 9.375 31.640625 15.03125 \n",
       "Q 36.328125 20.703125 36.328125 35.15625 \n",
       "z\n",
       "\" id=\"SimHei-68\"/>\n",
       "     <path d=\"M 45.3125 1.953125 \n",
       "L 4.6875 1.953125 \n",
       "L 4.6875 68.75 \n",
       "L 13.671875 68.75 \n",
       "L 13.671875 9.375 \n",
       "L 45.3125 9.375 \n",
       "z\n",
       "\" id=\"SimHei-76\"/>\n",
       "     <path d=\"M 44.53125 1.171875 \n",
       "L 37.890625 1.171875 \n",
       "L 36.71875 6.640625 \n",
       "Q 35.15625 4.296875 31.828125 2.734375 \n",
       "Q 28.515625 1.171875 24.609375 1.171875 \n",
       "Q 16.40625 1.171875 9.953125 8.78125 \n",
       "Q 3.515625 16.40625 3.515625 33.203125 \n",
       "Q 3.515625 51.5625 9.375 60.546875 \n",
       "Q 15.234375 69.53125 25.390625 69.53125 \n",
       "Q 34.375 69.53125 39.453125 62.890625 \n",
       "Q 44.53125 56.25 44.53125 45.703125 \n",
       "L 35.9375 45.703125 \n",
       "Q 35.9375 53.90625 33.203125 58 \n",
       "Q 30.46875 62.109375 25.390625 62.109375 \n",
       "Q 19.140625 62.109375 16.015625 55.65625 \n",
       "Q 12.890625 49.21875 12.890625 33.984375 \n",
       "Q 12.890625 19.53125 16.796875 14.0625 \n",
       "Q 20.703125 8.59375 25.78125 8.59375 \n",
       "Q 30.859375 8.59375 33.78125 12.296875 \n",
       "Q 36.71875 16.015625 36.71875 23.828125 \n",
       "L 36.71875 28.125 \n",
       "L 24.609375 28.125 \n",
       "L 24.609375 35.546875 \n",
       "L 44.53125 35.546875 \n",
       "z\n",
       "\" id=\"SimHei-71\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(158.497897 45.837391)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-67\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-68\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-76\"/>\n",
       "     <use x=\"150\" xlink:href=\"#SimHei-71\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_2\">\n",
       "    <!-- 38% -->\n",
       "    <defs>\n",
       "     <path d=\"M 3.90625 19.140625 \n",
       "L 10.9375 20.3125 \n",
       "Q 12.5 15.234375 16.015625 11.90625 \n",
       "Q 19.53125 8.59375 24.796875 8.78125 \n",
       "Q 30.078125 8.984375 33.203125 13.078125 \n",
       "Q 36.328125 17.1875 35.9375 22.453125 \n",
       "Q 35.546875 27.734375 31.828125 30.65625 \n",
       "Q 28.125 33.59375 19.921875 34.765625 \n",
       "L 19.921875 39.84375 \n",
       "Q 28.125 40.625 31.828125 44.140625 \n",
       "Q 35.546875 47.65625 35.15625 53.3125 \n",
       "Q 34.765625 58.984375 30.078125 61.515625 \n",
       "Q 25.390625 64.0625 20.109375 62.109375 \n",
       "Q 14.84375 60.15625 11.71875 51.171875 \n",
       "L 4.6875 52.34375 \n",
       "Q 7.03125 59.375 11.125 64.0625 \n",
       "Q 15.234375 68.75 22.265625 69.53125 \n",
       "Q 29.296875 70.3125 34.5625 67.765625 \n",
       "Q 39.84375 65.234375 41.984375 59.953125 \n",
       "Q 44.140625 54.6875 42.578125 48.4375 \n",
       "Q 41.015625 42.1875 33.59375 37.5 \n",
       "Q 39.0625 35.15625 41.984375 30.46875 \n",
       "Q 44.921875 25.78125 43.9375 18.15625 \n",
       "Q 42.96875 10.546875 37.109375 5.859375 \n",
       "Q 31.25 1.171875 23.828125 1.359375 \n",
       "Q 16.40625 1.5625 10.9375 6.046875 \n",
       "Q 5.46875 10.546875 3.90625 19.140625 \n",
       "z\n",
       "\" id=\"SimHei-51\"/>\n",
       "     <path d=\"M 2.734375 16.796875 \n",
       "Q 2.734375 26.171875 5.078125 30.65625 \n",
       "Q 7.421875 35.15625 12.890625 37.890625 \n",
       "Q 8.203125 40.625 6.640625 43.9375 \n",
       "Q 5.078125 47.265625 4.875 51.5625 \n",
       "Q 4.6875 55.859375 6.046875 58.984375 \n",
       "Q 7.421875 62.109375 10.15625 64.84375 \n",
       "Q 12.890625 67.578125 16.203125 68.546875 \n",
       "Q 19.53125 69.53125 23.4375 69.53125 \n",
       "Q 27.34375 69.53125 30.46875 68.75 \n",
       "Q 33.59375 67.96875 37.109375 65.421875 \n",
       "Q 40.625 62.890625 42.1875 58.203125 \n",
       "Q 43.75 53.515625 41.984375 47.265625 \n",
       "Q 40.234375 41.015625 32.8125 37.5 \n",
       "Q 39.453125 35.546875 42.1875 31.4375 \n",
       "Q 44.921875 27.34375 44.921875 21.484375 \n",
       "Q 44.921875 15.625 43.15625 12.109375 \n",
       "Q 41.40625 8.59375 39.25 6.25 \n",
       "Q 37.109375 3.90625 33.390625 2.53125 \n",
       "Q 29.6875 1.171875 24.015625 1.171875 \n",
       "Q 18.359375 1.171875 14.25 2.53125 \n",
       "Q 10.15625 3.90625 7.421875 6.640625 \n",
       "Q 4.6875 9.375 3.703125 13.078125 \n",
       "Q 2.734375 16.796875 2.734375 26.171875 \n",
       "z\n",
       "M 10.9375 26.5625 \n",
       "Q 10.546875 17.1875 12.296875 13.671875 \n",
       "Q 14.0625 10.15625 18.75 9.171875 \n",
       "Q 23.4375 8.203125 28.515625 9.375 \n",
       "Q 33.59375 10.546875 35.546875 14.84375 \n",
       "Q 37.5 19.140625 36.90625 23.4375 \n",
       "Q 36.328125 27.734375 32.03125 30.65625 \n",
       "Q 27.734375 33.59375 22.65625 33.203125 \n",
       "Q 17.578125 32.8125 14.25 29.6875 \n",
       "Q 10.9375 26.5625 10.546875 17.1875 \n",
       "z\n",
       "M 12.109375 56.25 \n",
       "Q 12.109375 48.4375 14.84375 44.921875 \n",
       "Q 17.578125 41.40625 23.4375 41.40625 \n",
       "Q 29.296875 41.40625 32.21875 44.921875 \n",
       "Q 35.15625 48.4375 34.953125 53.3125 \n",
       "Q 34.765625 58.203125 31.4375 60.546875 \n",
       "Q 28.125 62.890625 22.453125 62.5 \n",
       "Q 16.796875 62.109375 14.453125 59.171875 \n",
       "Q 12.109375 56.25 12.109375 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-56\"/>\n",
       "     <path d=\"M 21.875 51.953125 \n",
       "Q 21.875 40.625 18.546875 37.5 \n",
       "Q 15.234375 34.375 12.109375 34.375 \n",
       "Q 8.984375 34.375 5.65625 37.5 \n",
       "Q 2.34375 40.625 2.34375 51.953125 \n",
       "Q 2.34375 63.28125 5.65625 66.40625 \n",
       "Q 8.984375 69.53125 12.109375 69.53125 \n",
       "Q 15.234375 69.53125 18.546875 66.40625 \n",
       "Q 21.875 63.28125 21.875 51.953125 \n",
       "z\n",
       "M 41.015625 68.359375 \n",
       "L 10.9375 1.171875 \n",
       "L 7.8125 2.34375 \n",
       "L 37.890625 69.53125 \n",
       "z\n",
       "M 46.484375 18.75 \n",
       "Q 46.484375 7.421875 43.15625 4.296875 \n",
       "Q 39.84375 1.171875 36.71875 1.171875 \n",
       "Q 33.59375 1.171875 30.265625 4.296875 \n",
       "Q 26.953125 7.421875 26.953125 18.75 \n",
       "Q 26.953125 30.078125 30.265625 33.203125 \n",
       "Q 33.59375 36.328125 36.71875 36.328125 \n",
       "Q 39.84375 36.328125 43.15625 33.203125 \n",
       "Q 46.484375 30.078125 46.484375 18.75 \n",
       "z\n",
       "M 15.625 51.953125 \n",
       "Q 15.625 58.984375 14.84375 61.328125 \n",
       "Q 14.0625 63.671875 12.109375 63.671875 \n",
       "Q 10.15625 63.671875 9.375 61.328125 \n",
       "Q 8.59375 58.984375 8.59375 51.953125 \n",
       "Q 8.59375 44.921875 9.375 42.578125 \n",
       "Q 10.15625 40.234375 12.109375 40.234375 \n",
       "Q 14.0625 40.234375 14.84375 42.578125 \n",
       "Q 15.625 44.921875 15.625 51.953125 \n",
       "z\n",
       "M 40.234375 18.75 \n",
       "Q 40.234375 25.78125 39.453125 28.125 \n",
       "Q 38.671875 30.46875 36.71875 30.46875 \n",
       "Q 34.765625 30.46875 33.984375 28.125 \n",
       "Q 33.203125 25.78125 33.203125 18.75 \n",
       "Q 33.203125 11.71875 33.984375 9.375 \n",
       "Q 34.765625 7.03125 36.71875 7.03125 \n",
       "Q 38.671875 7.03125 39.453125 9.375 \n",
       "Q 40.234375 11.71875 40.234375 18.75 \n",
       "z\n",
       "\" id=\"SimHei-37\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(134.585151 86.109315)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-51\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-56\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-37\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_3\">\n",
       "    <!-- CDNL -->\n",
       "    <defs>\n",
       "     <path d=\"M 44.53125 1.953125 \n",
       "L 34.765625 1.953125 \n",
       "L 13.28125 50.390625 \n",
       "L 12.890625 50.390625 \n",
       "L 12.890625 1.953125 \n",
       "L 3.90625 1.953125 \n",
       "L 3.90625 68.75 \n",
       "L 13.671875 68.75 \n",
       "L 35.15625 20.3125 \n",
       "L 35.546875 20.3125 \n",
       "L 35.546875 68.75 \n",
       "L 44.53125 68.75 \n",
       "z\n",
       "\" id=\"SimHei-78\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(7.2 144.044429)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-67\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-68\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-78\"/>\n",
       "     <use x=\"150\" xlink:href=\"#SimHei-76\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_4\">\n",
       "    <!-- 28% -->\n",
       "    <defs>\n",
       "     <path d=\"M 4.6875 3.90625 \n",
       "Q 5.078125 9.765625 10.15625 14.453125 \n",
       "Q 15.234375 19.140625 23.046875 29.09375 \n",
       "Q 30.859375 39.0625 33.203125 44.53125 \n",
       "Q 35.546875 50 34.953125 53.90625 \n",
       "Q 34.375 57.8125 31.25 60.34375 \n",
       "Q 28.125 62.890625 24.015625 62.5 \n",
       "Q 19.921875 62.109375 16.203125 59.375 \n",
       "Q 12.5 56.640625 10.546875 51.171875 \n",
       "L 3.125 52.34375 \n",
       "Q 6.25 61.328125 11.125 65.421875 \n",
       "Q 16.015625 69.53125 22.65625 69.921875 \n",
       "Q 26.5625 70.3125 29.6875 69.71875 \n",
       "Q 32.8125 69.140625 36.125 66.984375 \n",
       "Q 39.453125 64.84375 41.59375 60.546875 \n",
       "Q 43.75 56.25 43.15625 50.1875 \n",
       "Q 42.578125 44.140625 37.109375 35.734375 \n",
       "Q 31.640625 27.34375 16.015625 9.375 \n",
       "L 44.140625 9.375 \n",
       "L 44.140625 2.34375 \n",
       "L 4.6875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-50\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(62.968116 139.676791)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-50\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-56\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-37\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_5\">\n",
       "    <!-- CDXL -->\n",
       "    <defs>\n",
       "     <path d=\"M 46.875 1.953125 \n",
       "L 37.5 1.953125 \n",
       "L 24.21875 29.296875 \n",
       "L 10.9375 1.953125 \n",
       "L 1.5625 1.953125 \n",
       "L 19.921875 37.109375 \n",
       "L 3.515625 68.75 \n",
       "L 12.890625 68.75 \n",
       "L 24.21875 44.53125 \n",
       "L 35.546875 68.75 \n",
       "L 44.921875 68.75 \n",
       "L 28.515625 37.109375 \n",
       "z\n",
       "\" id=\"SimHei-88\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(167.21353 218.959444)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-67\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-68\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-88\"/>\n",
       "     <use x=\"150\" xlink:href=\"#SimHei-76\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_6\">\n",
       "    <!-- 34% -->\n",
       "    <defs>\n",
       "     <path d=\"M 31.25 17.1875 \n",
       "L 1.171875 17.1875 \n",
       "L 1.171875 23.828125 \n",
       "L 32.8125 69.53125 \n",
       "L 38.671875 69.53125 \n",
       "L 38.671875 23.828125 \n",
       "L 48.046875 23.828125 \n",
       "L 48.046875 17.1875 \n",
       "L 38.671875 17.1875 \n",
       "L 38.671875 2.34375 \n",
       "L 31.25 2.34375 \n",
       "z\n",
       "M 31.25 23.828125 \n",
       "L 31.25 54.6875 \n",
       "L 9.375 23.828125 \n",
       "z\n",
       "\" id=\"SimHei-52\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(139.339133 180.539526)scale(0.1 -0.1)\">\n",
       "     <use xlink:href=\"#SimHei-51\"/>\n",
       "     <use x=\"50\" xlink:href=\"#SimHei-52\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-37\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_7\">\n",
       "    <!-- 不同门店的销售额占比 -->\n",
       "    <defs>\n",
       "     <path d=\"M 93.359375 69.53125 \n",
       "Q 86.328125 69.921875 81.25 69.921875 \n",
       "L 58.203125 69.921875 \n",
       "Q 55.46875 64.453125 51.5625 57.8125 \n",
       "L 51.5625 8.984375 \n",
       "Q 51.5625 1.171875 51.953125 -8.59375 \n",
       "L 43.359375 -8.59375 \n",
       "Q 43.75 0.78125 43.75 8.984375 \n",
       "L 43.75 47.265625 \n",
       "Q 31.640625 30.46875 10.9375 16.40625 \n",
       "Q 7.8125 21.09375 5.078125 23.046875 \n",
       "Q 12.890625 26.5625 25.78125 38.078125 \n",
       "Q 38.671875 49.609375 49.609375 69.921875 \n",
       "L 23.828125 69.921875 \n",
       "Q 16.40625 69.921875 8.203125 69.53125 \n",
       "L 8.203125 77.34375 \n",
       "Q 19.921875 76.953125 26.171875 76.953125 \n",
       "L 80.859375 76.953125 \n",
       "Q 85.9375 76.953125 93.359375 77.34375 \n",
       "z\n",
       "M 85.15625 17.578125 \n",
       "Q 77.734375 26.953125 58.59375 46.484375 \n",
       "Q 61.71875 49.21875 63.671875 51.953125 \n",
       "Q 73.046875 43.359375 79.6875 36.90625 \n",
       "Q 86.328125 30.46875 92.1875 24.21875 \n",
       "Q 88.28125 21.09375 85.15625 17.578125 \n",
       "z\n",
       "\" id=\"SimHei-19981\"/>\n",
       "     <path d=\"M 91.015625 76.953125 \n",
       "Q 90.234375 71.09375 90.234375 62.109375 \n",
       "L 90.234375 -0.78125 \n",
       "Q 90.234375 -6.25 86.328125 -7.609375 \n",
       "Q 82.421875 -8.984375 73.828125 -9.765625 \n",
       "Q 73.828125 -6.25 70.703125 -0.78125 \n",
       "Q 76.953125 -0.78125 79.6875 -0.1875 \n",
       "Q 82.421875 0.390625 82.421875 3.125 \n",
       "L 82.421875 69.53125 \n",
       "L 17.96875 69.53125 \n",
       "L 17.96875 -9.375 \n",
       "L 8.984375 -9.375 \n",
       "Q 9.375 -3.90625 9.765625 3.125 \n",
       "L 9.765625 62.109375 \n",
       "Q 9.765625 71.484375 9.375 76.953125 \n",
       "L 91.015625 76.953125 \n",
       "z\n",
       "M 68.359375 39.84375 \n",
       "Q 67.578125 35.546875 67.578125 26.5625 \n",
       "Q 67.578125 17.96875 68.359375 11.328125 \n",
       "L 31.640625 11.328125 \n",
       "Q 32.03125 18.359375 32.03125 27.34375 \n",
       "Q 32.03125 36.328125 31.640625 39.84375 \n",
       "L 68.359375 39.84375 \n",
       "z\n",
       "M 64.0625 58.59375 \n",
       "Q 71.875 58.59375 75.390625 58.984375 \n",
       "L 75.390625 51.171875 \n",
       "Q 71.484375 51.5625 63.671875 51.5625 \n",
       "L 38.28125 51.5625 \n",
       "Q 28.90625 51.5625 25 51.171875 \n",
       "L 25 58.984375 \n",
       "Q 29.296875 58.59375 38.671875 58.59375 \n",
       "z\n",
       "M 60.546875 17.96875 \n",
       "L 60.546875 33.59375 \n",
       "L 39.453125 33.59375 \n",
       "L 39.453125 17.96875 \n",
       "z\n",
       "\" id=\"SimHei-21516\"/>\n",
       "     <path d=\"M 90.625 75.390625 \n",
       "Q 90.234375 67.578125 90.234375 60.15625 \n",
       "L 90.234375 5.859375 \n",
       "Q 90.234375 -3.515625 85.15625 -5.078125 \n",
       "Q 80.078125 -6.640625 73.046875 -7.421875 \n",
       "Q 72.265625 -3.125 69.53125 1.5625 \n",
       "Q 77.34375 1.5625 79.6875 2.53125 \n",
       "Q 82.03125 3.515625 82.03125 7.421875 \n",
       "L 82.03125 68.75 \n",
       "L 58.984375 68.75 \n",
       "Q 49.609375 68.75 42.1875 67.578125 \n",
       "L 42.1875 75.78125 \n",
       "Q 55.859375 75.390625 58.984375 75.390625 \n",
       "z\n",
       "M 18.359375 60.546875 \n",
       "Q 17.96875 54.6875 17.96875 50 \n",
       "L 17.96875 -7.03125 \n",
       "L 9.375 -7.03125 \n",
       "Q 9.765625 0.390625 9.765625 7.03125 \n",
       "L 9.765625 48.046875 \n",
       "Q 9.765625 54.6875 9.375 60.546875 \n",
       "L 18.359375 60.546875 \n",
       "z\n",
       "M 23.828125 82.8125 \n",
       "Q 28.515625 75.390625 33.59375 68.359375 \n",
       "Q 30.078125 66.015625 25.78125 63.671875 \n",
       "Q 21.09375 71.09375 16.015625 78.125 \n",
       "Q 20.3125 80.46875 23.828125 82.8125 \n",
       "z\n",
       "\" id=\"SimHei-38376\"/>\n",
       "     <path d=\"M 59.375 60.9375 \n",
       "Q 58.984375 54.6875 58.984375 48.828125 \n",
       "L 79.6875 48.828125 \n",
       "Q 85.9375 48.828125 90.625 49.21875 \n",
       "L 90.625 41.796875 \n",
       "Q 86.328125 42.1875 79.6875 42.1875 \n",
       "L 58.984375 42.1875 \n",
       "L 58.984375 28.90625 \n",
       "L 84.765625 28.90625 \n",
       "Q 84.375 18.75 84.375 10.15625 \n",
       "Q 84.375 1.5625 84.765625 -8.203125 \n",
       "L 76.5625 -8.203125 \n",
       "L 76.5625 -1.171875 \n",
       "L 37.5 -1.171875 \n",
       "L 37.5 -8.59375 \n",
       "L 29.6875 -8.59375 \n",
       "Q 30.078125 2.34375 30.078125 10.9375 \n",
       "Q 30.078125 19.921875 29.6875 28.90625 \n",
       "L 51.171875 28.90625 \n",
       "L 51.171875 48.4375 \n",
       "Q 51.171875 55.078125 50.78125 60.9375 \n",
       "L 59.375 60.9375 \n",
       "z\n",
       "M 53.90625 82.03125 \n",
       "Q 56.640625 75.390625 58.59375 69.53125 \n",
       "L 72.265625 69.53125 \n",
       "Q 82.421875 69.53125 89.84375 69.921875 \n",
       "L 89.84375 62.890625 \n",
       "Q 82.8125 63.28125 75.390625 63.28125 \n",
       "L 23.046875 63.28125 \n",
       "Q 23.046875 38.28125 22.65625 29.09375 \n",
       "Q 22.265625 19.921875 20.3125 10.34375 \n",
       "Q 18.359375 0.78125 14.0625 -8.203125 \n",
       "Q 10.546875 -5.46875 5.859375 -3.515625 \n",
       "Q 11.71875 5.46875 13.46875 16.59375 \n",
       "Q 15.234375 27.734375 15.421875 40.8125 \n",
       "Q 15.625 53.90625 14.84375 69.53125 \n",
       "L 49.21875 69.53125 \n",
       "Q 48.4375 73.046875 45.703125 79.296875 \n",
       "Q 49.609375 80.078125 53.90625 82.03125 \n",
       "z\n",
       "M 76.5625 5.078125 \n",
       "L 76.5625 22.265625 \n",
       "L 37.5 22.265625 \n",
       "L 37.5 5.078125 \n",
       "z\n",
       "\" id=\"SimHei-24215\"/>\n",
       "     <path d=\"M 32.8125 77.734375 \n",
       "Q 30.859375 74.21875 27.34375 61.71875 \n",
       "L 44.921875 61.71875 \n",
       "Q 44.53125 55.078125 44.53125 44.921875 \n",
       "L 44.53125 10.546875 \n",
       "Q 44.53125 4.6875 44.921875 -6.25 \n",
       "L 37.109375 -6.25 \n",
       "L 37.109375 1.5625 \n",
       "L 17.1875 1.5625 \n",
       "L 17.1875 -7.03125 \n",
       "L 9.375 -7.03125 \n",
       "Q 9.765625 5.46875 9.765625 8.59375 \n",
       "L 9.765625 44.53125 \n",
       "Q 9.765625 55.078125 9.375 61.71875 \n",
       "L 20.703125 61.71875 \n",
       "Q 22.65625 70.703125 23.828125 80.46875 \n",
       "Q 29.296875 78.515625 32.8125 77.734375 \n",
       "z\n",
       "M 91.015625 48.046875 \n",
       "Q 90.625 24.21875 89.0625 2.734375 \n",
       "Q 88.28125 -4.296875 81.640625 -6.640625 \n",
       "Q 75 -8.984375 66.796875 -9.765625 \n",
       "Q 66.40625 -5.46875 63.28125 -0.78125 \n",
       "Q 71.09375 -1.171875 75.578125 -0.390625 \n",
       "Q 80.078125 0.390625 81.25 3.125 \n",
       "Q 82.421875 5.859375 83 19.140625 \n",
       "Q 83.59375 32.421875 83.984375 56.25 \n",
       "L 61.328125 56.25 \n",
       "Q 58.203125 48.828125 52.34375 38.671875 \n",
       "Q 49.609375 41.40625 45.703125 42.96875 \n",
       "Q 49.21875 47.65625 52.34375 54.296875 \n",
       "Q 55.46875 60.9375 57.8125 68.75 \n",
       "Q 60.15625 76.5625 60.546875 80.859375 \n",
       "Q 66.015625 78.515625 69.921875 77.34375 \n",
       "Q 67.96875 74.21875 66.59375 70.5 \n",
       "Q 65.234375 66.796875 63.671875 63.28125 \n",
       "L 91.40625 63.28125 \n",
       "Q 91.015625 55.078125 91.015625 48.046875 \n",
       "z\n",
       "M 37.109375 8.203125 \n",
       "L 37.109375 28.90625 \n",
       "L 17.1875 28.90625 \n",
       "L 17.1875 8.203125 \n",
       "z\n",
       "M 37.109375 35.546875 \n",
       "L 37.109375 55.078125 \n",
       "L 17.1875 55.078125 \n",
       "L 17.1875 35.546875 \n",
       "z\n",
       "M 67.96875 32.03125 \n",
       "Q 70.3125 27.34375 73.4375 19.921875 \n",
       "Q 70.703125 18.75 66.015625 16.015625 \n",
       "Q 63.28125 23.4375 60.9375 28.703125 \n",
       "Q 58.59375 33.984375 56.25 37.5 \n",
       "Q 58.984375 39.0625 63.28125 41.40625 \n",
       "z\n",
       "\" id=\"SimHei-30340\"/>\n",
       "     <path d=\"M 65.234375 67.578125 \n",
       "Q 65.234375 73.4375 64.84375 80.078125 \n",
       "L 72.65625 80.078125 \n",
       "Q 72.265625 75.78125 72.265625 67.578125 \n",
       "L 72.265625 50.390625 \n",
       "L 91.015625 50.390625 \n",
       "Q 90.625 44.53125 90.625 34.765625 \n",
       "L 90.625 0.78125 \n",
       "Q 90.625 -4.6875 86.90625 -5.859375 \n",
       "Q 83.203125 -7.03125 76.953125 -8.203125 \n",
       "Q 76.171875 -4.296875 73.4375 -0.390625 \n",
       "Q 82.421875 0 82.8125 1.75 \n",
       "Q 83.203125 3.515625 83.203125 12.890625 \n",
       "L 55.859375 12.890625 \n",
       "L 55.859375 -7.03125 \n",
       "L 48.4375 -7.03125 \n",
       "Q 48.828125 1.171875 48.828125 6.25 \n",
       "L 48.828125 33.984375 \n",
       "Q 48.828125 43.75 48.4375 50.390625 \n",
       "L 65.234375 50.390625 \n",
       "z\n",
       "M 36.71875 42.1875 \n",
       "Q 31.640625 42.578125 26.5625 42.578125 \n",
       "L 26.5625 30.859375 \n",
       "Q 33.203125 30.859375 40.625 31.25 \n",
       "L 40.625 24.21875 \n",
       "Q 33.203125 24.609375 26.5625 24.609375 \n",
       "L 26.5625 6.640625 \n",
       "Q 30.078125 8.984375 35.15625 14.453125 \n",
       "Q 36.328125 10.9375 39.0625 7.421875 \n",
       "Q 35.15625 4.6875 30.859375 1.359375 \n",
       "Q 26.5625 -1.953125 21.875 -7.03125 \n",
       "Q 19.921875 -3.515625 16.796875 -0.78125 \n",
       "Q 19.140625 1.5625 19.53125 6.25 \n",
       "L 19.53125 24.609375 \n",
       "Q 14.84375 24.609375 8.203125 24.21875 \n",
       "L 8.203125 31.25 \n",
       "Q 14.84375 30.859375 19.53125 30.859375 \n",
       "L 19.53125 42.578125 \n",
       "Q 14.84375 42.578125 11.71875 42.1875 \n",
       "L 11.71875 49.21875 \n",
       "Q 16.796875 48.828125 23.4375 48.828125 \n",
       "Q 30.46875 48.828125 36.71875 49.21875 \n",
       "z\n",
       "M 9.765625 48.046875 \n",
       "Q 7.03125 51.171875 3.515625 52.734375 \n",
       "Q 9.375 58.59375 13.671875 65.625 \n",
       "Q 17.96875 72.65625 20.703125 80.078125 \n",
       "Q 26.171875 76.953125 29.296875 75.78125 \n",
       "Q 24.21875 68.75 22.65625 65.625 \n",
       "Q 32.421875 65.625 39.0625 66.015625 \n",
       "L 39.0625 58.59375 \n",
       "Q 32.421875 58.984375 18.75 58.984375 \n",
       "Q 12.890625 51.171875 9.765625 48.046875 \n",
       "z\n",
       "M 83.203125 34.375 \n",
       "L 83.203125 44.53125 \n",
       "L 55.859375 44.53125 \n",
       "L 55.859375 34.375 \n",
       "z\n",
       "M 83.203125 18.75 \n",
       "L 83.203125 28.515625 \n",
       "L 55.859375 28.515625 \n",
       "L 55.859375 18.75 \n",
       "z\n",
       "M 94.53125 71.09375 \n",
       "Q 91.40625 67.1875 85.15625 55.078125 \n",
       "Q 81.640625 57.03125 77.734375 58.203125 \n",
       "Q 82.03125 63.28125 86.328125 74.609375 \n",
       "Q 89.453125 72.65625 94.53125 71.09375 \n",
       "z\n",
       "M 50 74.609375 \n",
       "Q 56.25 64.84375 59.375 59.375 \n",
       "Q 55.859375 57.8125 52.34375 55.46875 \n",
       "Q 49.609375 61.71875 43.359375 70.703125 \n",
       "Q 47.265625 72.265625 50 74.609375 \n",
       "z\n",
       "\" id=\"SimHei-38144\"/>\n",
       "     <path d=\"M 36.328125 76.953125 \n",
       "Q 34.375 75.390625 30.46875 69.140625 \n",
       "L 76.953125 69.140625 \n",
       "Q 83.59375 69.140625 90.234375 69.53125 \n",
       "L 90.234375 63.28125 \n",
       "Q 83.59375 63.671875 76.953125 63.671875 \n",
       "L 58.984375 63.671875 \n",
       "L 58.984375 57.03125 \n",
       "L 72.65625 57.03125 \n",
       "Q 79.296875 57.03125 85.15625 57.421875 \n",
       "L 85.15625 50.390625 \n",
       "Q 79.6875 51.171875 73.046875 51.171875 \n",
       "L 58.984375 51.171875 \n",
       "L 58.984375 44.53125 \n",
       "L 85.546875 44.53125 \n",
       "L 85.546875 37.890625 \n",
       "Q 80.078125 38.28125 73.4375 38.28125 \n",
       "L 58.984375 38.28125 \n",
       "L 58.984375 30.859375 \n",
       "L 75.390625 30.859375 \n",
       "Q 83.203125 30.859375 92.1875 31.25 \n",
       "L 92.1875 24.21875 \n",
       "Q 83.59375 25 75.390625 25 \n",
       "L 28.125 25 \n",
       "L 28.125 21.484375 \n",
       "L 19.921875 21.484375 \n",
       "Q 20.3125 30.859375 20.3125 53.125 \n",
       "Q 15.234375 44.53125 10.9375 40.234375 \n",
       "Q 8.203125 43.75 5.46875 45.3125 \n",
       "Q 9.765625 50.390625 13.078125 55.265625 \n",
       "Q 16.40625 60.15625 20.3125 66.203125 \n",
       "Q 24.21875 72.265625 26.953125 81.640625 \n",
       "Q 32.03125 78.90625 36.328125 76.953125 \n",
       "z\n",
       "M 83.59375 18.359375 \n",
       "Q 83.203125 12.5 83.203125 4.296875 \n",
       "Q 83.203125 -3.90625 83.59375 -10.15625 \n",
       "L 75.390625 -10.15625 \n",
       "L 75.390625 -5.859375 \n",
       "L 26.953125 -5.859375 \n",
       "L 26.953125 -10.546875 \n",
       "L 18.75 -10.546875 \n",
       "Q 19.53125 -3.90625 19.53125 4.296875 \n",
       "Q 19.53125 12.5 18.75 18.359375 \n",
       "L 83.59375 18.359375 \n",
       "z\n",
       "M 75.390625 0.390625 \n",
       "L 75.390625 12.109375 \n",
       "L 26.953125 12.109375 \n",
       "L 26.953125 0.390625 \n",
       "z\n",
       "M 51.171875 30.859375 \n",
       "L 51.171875 38.28125 \n",
       "L 28.125 38.28125 \n",
       "L 28.125 30.859375 \n",
       "z\n",
       "M 51.171875 57.03125 \n",
       "L 51.171875 63.671875 \n",
       "L 28.125 63.671875 \n",
       "L 28.125 57.03125 \n",
       "z\n",
       "M 51.171875 44.53125 \n",
       "L 51.171875 51.171875 \n",
       "L 28.125 51.171875 \n",
       "L 28.125 44.53125 \n",
       "z\n",
       "M 56.25 82.421875 \n",
       "Q 60.15625 76.171875 61.71875 73.046875 \n",
       "Q 59.375 72.265625 54.6875 70.3125 \n",
       "Q 53.515625 73.4375 49.609375 79.296875 \n",
       "Q 53.125 80.46875 56.25 82.421875 \n",
       "z\n",
       "\" id=\"SimHei-21806\"/>\n",
       "     <path d=\"M 30.078125 57.8125 \n",
       "Q 26.953125 55.46875 24.21875 52.34375 \n",
       "L 46.09375 52.34375 \n",
       "Q 44.921875 49.21875 42.1875 44.921875 \n",
       "Q 39.453125 40.625 35.9375 35.9375 \n",
       "Q 39.0625 34.375 42.375 32.421875 \n",
       "Q 45.703125 30.46875 51.171875 26.953125 \n",
       "Q 48.828125 24.609375 46.09375 20.703125 \n",
       "Q 42.1875 23.828125 38.671875 25.96875 \n",
       "Q 35.15625 28.125 30.46875 30.46875 \n",
       "Q 24.609375 25.78125 17.96875 21.484375 \n",
       "L 43.75 21.484375 \n",
       "Q 43.359375 14.84375 43.359375 7.8125 \n",
       "Q 43.359375 0.78125 43.75 -7.03125 \n",
       "L 36.328125 -7.03125 \n",
       "L 36.328125 -0.78125 \n",
       "L 20.703125 -0.78125 \n",
       "L 20.703125 -8.984375 \n",
       "L 13.671875 -8.984375 \n",
       "Q 14.0625 -1.171875 14.0625 4.296875 \n",
       "L 14.0625 18.359375 \n",
       "Q 10.546875 16.796875 8.59375 15.625 \n",
       "Q 6.25 19.140625 3.515625 21.875 \n",
       "Q 9.765625 24.21875 15.234375 27.53125 \n",
       "Q 20.703125 30.859375 24.21875 34.375 \n",
       "Q 20.3125 36.71875 16.796875 38.671875 \n",
       "Q 18.359375 41.015625 21.09375 43.75 \n",
       "Q 25.390625 41.40625 30.078125 39.0625 \n",
       "Q 33.59375 42.96875 35.9375 46.875 \n",
       "L 20.3125 46.875 \n",
       "Q 18.75 44.921875 16.015625 41.984375 \n",
       "Q 13.28125 39.0625 10.15625 35.546875 \n",
       "Q 7.421875 37.890625 3.90625 40.234375 \n",
       "Q 10.15625 44.921875 14.640625 50.578125 \n",
       "Q 19.140625 56.25 21.484375 61.328125 \n",
       "Q 25.78125 59.375 30.078125 57.8125 \n",
       "z\n",
       "M 64.84375 68.75 \n",
       "Q 58.984375 68.75 52.734375 68.359375 \n",
       "L 52.734375 75.390625 \n",
       "Q 58.59375 75 65.625 75 \n",
       "L 82.8125 75 \n",
       "Q 87.5 75 93.75 75.390625 \n",
       "L 93.75 68.359375 \n",
       "Q 87.890625 68.75 82.8125 68.75 \n",
       "L 77.34375 68.75 \n",
       "Q 75.78125 62.109375 73.828125 55.078125 \n",
       "L 89.84375 55.078125 \n",
       "Q 89.453125 48.828125 89.453125 43.359375 \n",
       "L 89.453125 25.390625 \n",
       "Q 89.453125 20.3125 89.84375 12.890625 \n",
       "L 82.8125 12.890625 \n",
       "L 82.8125 49.609375 \n",
       "L 61.328125 49.609375 \n",
       "L 61.328125 12.5 \n",
       "L 53.90625 12.5 \n",
       "Q 54.296875 19.921875 54.296875 25.78125 \n",
       "L 54.296875 43.75 \n",
       "Q 54.296875 49.609375 53.90625 55.078125 \n",
       "L 67.1875 55.078125 \n",
       "Q 68.75 62.890625 69.53125 68.75 \n",
       "z\n",
       "M 32.03125 79.6875 \n",
       "Q 32.8125 75.390625 34.375 69.921875 \n",
       "L 50.390625 69.921875 \n",
       "Q 50 66.796875 50 63.671875 \n",
       "Q 50 60.546875 50.390625 57.421875 \n",
       "L 43.359375 57.421875 \n",
       "L 43.359375 64.0625 \n",
       "L 13.671875 64.0625 \n",
       "L 13.671875 54.6875 \n",
       "L 6.25 54.6875 \n",
       "Q 6.640625 58.984375 6.640625 62.5 \n",
       "Q 6.640625 66.40625 6.25 69.921875 \n",
       "L 25.78125 69.921875 \n",
       "Q 24.21875 74.21875 23.046875 78.125 \n",
       "Q 28.125 78.90625 32.03125 79.6875 \n",
       "z\n",
       "M 76.953125 42.578125 \n",
       "Q 75.78125 37.890625 75.578125 31.640625 \n",
       "Q 75.390625 25.390625 73.625 18.359375 \n",
       "Q 71.875 11.328125 66.59375 3.90625 \n",
       "Q 61.328125 -3.515625 50.78125 -10.546875 \n",
       "Q 47.65625 -6.640625 44.53125 -3.90625 \n",
       "Q 52.734375 -0.390625 57.609375 4.09375 \n",
       "Q 62.5 8.59375 65.03125 14.640625 \n",
       "Q 67.578125 20.703125 67.96875 27.34375 \n",
       "Q 68.359375 33.984375 68.359375 43.359375 \n",
       "Q 71.484375 42.96875 76.953125 42.578125 \n",
       "z\n",
       "M 36.328125 5.078125 \n",
       "L 36.328125 16.015625 \n",
       "L 20.703125 16.015625 \n",
       "L 20.703125 5.078125 \n",
       "z\n",
       "M 79.296875 12.5 \n",
       "Q 82.8125 8.984375 85.734375 6.25 \n",
       "Q 88.671875 3.515625 94.140625 -1.5625 \n",
       "Q 90.625 -4.296875 87.5 -7.8125 \n",
       "Q 85.15625 -4.296875 82.421875 -1.359375 \n",
       "Q 79.6875 1.5625 73.046875 6.25 \n",
       "Q 76.171875 8.984375 79.296875 12.5 \n",
       "z\n",
       "\" id=\"SimHei-39069\"/>\n",
       "     <path d=\"M 42.578125 68.75 \n",
       "Q 42.578125 75 42.1875 79.296875 \n",
       "L 52.734375 79.296875 \n",
       "Q 52.34375 74.609375 52.34375 68.75 \n",
       "L 52.34375 62.5 \n",
       "L 82.03125 62.5 \n",
       "Q 92.1875 62.5 96.09375 62.890625 \n",
       "L 96.09375 55.078125 \n",
       "Q 92.1875 55.46875 82.8125 55.46875 \n",
       "L 52.34375 55.46875 \n",
       "L 52.34375 36.328125 \n",
       "L 85.15625 36.328125 \n",
       "Q 84.375 31.25 84.375 23.828125 \n",
       "L 84.375 5.078125 \n",
       "Q 84.375 -3.90625 85.15625 -8.59375 \n",
       "L 75.78125 -8.59375 \n",
       "L 75.78125 -0.390625 \n",
       "L 23.046875 -0.390625 \n",
       "L 23.046875 -8.59375 \n",
       "L 13.671875 -8.59375 \n",
       "Q 14.0625 -2.34375 14.0625 2.734375 \n",
       "L 14.0625 24.21875 \n",
       "Q 14.0625 31.25 13.671875 36.328125 \n",
       "L 42.578125 36.328125 \n",
       "z\n",
       "M 75.78125 6.640625 \n",
       "L 75.78125 29.296875 \n",
       "L 23.046875 29.296875 \n",
       "L 23.046875 6.640625 \n",
       "z\n",
       "\" id=\"SimHei-21344\"/>\n",
       "     <path d=\"M 58.984375 79.6875 \n",
       "Q 58.59375 71.484375 58.59375 64.0625 \n",
       "L 58.59375 47.65625 \n",
       "Q 76.953125 56.25 85.546875 65.234375 \n",
       "Q 88.671875 60.9375 92.1875 57.421875 \n",
       "Q 87.5 54.6875 78.703125 49.796875 \n",
       "Q 69.921875 44.921875 58.59375 39.84375 \n",
       "L 58.59375 7.03125 \n",
       "Q 58.59375 1.5625 63.28125 1.5625 \n",
       "L 78.125 1.5625 \n",
       "Q 80.859375 1.5625 82.21875 3.90625 \n",
       "Q 83.59375 6.25 85.15625 14.0625 \n",
       "Q 88.28125 12.109375 94.140625 10.546875 \n",
       "Q 91.40625 0 88.28125 -2.734375 \n",
       "Q 85.15625 -5.46875 81.640625 -5.46875 \n",
       "L 60.9375 -5.46875 \n",
       "Q 50.78125 -5.46875 50.78125 4.296875 \n",
       "L 50.78125 62.5 \n",
       "Q 50.78125 71.09375 50.390625 79.6875 \n",
       "L 58.984375 79.6875 \n",
       "z\n",
       "M 19.921875 77.734375 \n",
       "Q 19.53125 71.484375 19.53125 62.5 \n",
       "L 19.53125 49.21875 \n",
       "L 28.90625 49.21875 \n",
       "Q 36.328125 49.21875 44.921875 49.609375 \n",
       "L 44.921875 41.40625 \n",
       "Q 36.328125 41.796875 28.90625 41.796875 \n",
       "L 19.53125 41.796875 \n",
       "L 19.53125 7.421875 \n",
       "Q 25.78125 10.15625 30.65625 12.6875 \n",
       "Q 35.546875 15.234375 44.53125 19.921875 \n",
       "Q 45.3125 14.84375 46.09375 11.71875 \n",
       "Q 37.109375 7.421875 27.53125 2.734375 \n",
       "Q 17.96875 -1.953125 14.453125 -5.078125 \n",
       "Q 11.71875 -1.5625 8.984375 3.125 \n",
       "Q 10.9375 4.6875 11.71875 9.375 \n",
       "L 11.71875 61.71875 \n",
       "Q 11.71875 71.09375 11.328125 77.734375 \n",
       "L 19.921875 77.734375 \n",
       "z\n",
       "\" id=\"SimHei-27604\"/>\n",
       "    </defs>\n",
       "    <g transform=\"translate(62.389856 16.903125)scale(0.12 -0.12)\">\n",
       "     <use xlink:href=\"#SimHei-19981\"/>\n",
       "     <use x=\"100\" xlink:href=\"#SimHei-21516\"/>\n",
       "     <use x=\"200\" xlink:href=\"#SimHei-38376\"/>\n",
       "     <use x=\"300\" xlink:href=\"#SimHei-24215\"/>\n",
       "     <use x=\"400\" xlink:href=\"#SimHei-30340\"/>\n",
       "     <use x=\"500\" xlink:href=\"#SimHei-38144\"/>\n",
       "     <use x=\"600\" xlink:href=\"#SimHei-21806\"/>\n",
       "     <use x=\"700\" xlink:href=\"#SimHei-39069\"/>\n",
       "     <use x=\"800\" xlink:href=\"#SimHei-21344\"/>\n",
       "     <use x=\"900\" xlink:href=\"#SimHei-27604\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data['销售额'] = data['销量'] * data['单价']\n",
    "data.groupby('门店编号')['销售额'].sum()\n",
    "data.groupby('门店编号')['销售额'].sum() / data['销售额'].sum()\n",
    "# (data.groupby('门店编号')['销售额'].sum() / data['销售额'].sum()).plot.pie()\n",
    "\n",
    "\n",
    "d = data.groupby('门店编号')['销售额'].sum() / data['销售额'].sum()\n",
    "type(d.index.values)\n",
    "plt.subplot(1, 1, 1)\n",
    "plt.pie(x=d.values, labels=d.index.values, autopct='%.0f%%')\n",
    "plt.title('不同门店的销售额占比')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.4 哪些时间段是超市的客流高峰\n",
    "了解清楚哪些时段是超市客流的高峰期很必要，可以帮助超市管理人员提前布置工作人员，决定在什么时段开展促销活动。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x11eff32d0>"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"260.066562pt\" version=\"1.1\" viewBox=\"0 0 371.2 260.066562\" width=\"371.2pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 260.066562 \n",
       "L 371.2 260.066562 \n",
       "L 371.2 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 29.2 224.64 \n",
       "L 364 224.64 \n",
       "L 364 7.2 \n",
       "L 29.2 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m7f3bbb2f2b\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 6 -->\n",
       "      <defs>\n",
       "       <path d=\"M 3.515625 19.53125 \n",
       "Q 4.296875 30.859375 6.046875 34.765625 \n",
       "Q 7.8125 38.671875 11.328125 44.53125 \n",
       "L 27.34375 69.53125 \n",
       "L 36.328125 69.53125 \n",
       "L 19.921875 43.75 \n",
       "Q 30.46875 46.484375 36.71875 42.96875 \n",
       "Q 42.96875 39.453125 45.109375 34.953125 \n",
       "Q 47.265625 30.46875 47.453125 25.1875 \n",
       "Q 47.65625 19.921875 45.890625 14.84375 \n",
       "Q 44.140625 9.765625 39.640625 5.65625 \n",
       "Q 35.15625 1.5625 27.140625 1.171875 \n",
       "Q 19.140625 0.78125 13.46875 4.09375 \n",
       "Q 7.8125 7.421875 5.65625 13.46875 \n",
       "Q 3.515625 19.53125 4.296875 30.859375 \n",
       "z\n",
       "M 12.5 16.015625 \n",
       "Q 19.53125 8.59375 25.390625 8.203125 \n",
       "Q 31.25 7.8125 35.15625 12.109375 \n",
       "Q 39.0625 16.40625 39.0625 24.609375 \n",
       "Q 39.0625 32.8125 34.171875 35.9375 \n",
       "Q 29.296875 39.0625 23.234375 38.28125 \n",
       "Q 17.1875 37.5 14.453125 32.421875 \n",
       "Q 11.71875 27.34375 12.109375 21.671875 \n",
       "Q 12.5 16.015625 19.53125 8.59375 \n",
       "z\n",
       "\" id=\"SimHei-54\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(26.7 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-54\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"73.84\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 8 -->\n",
       "      <defs>\n",
       "       <path d=\"M 2.734375 16.796875 \n",
       "Q 2.734375 26.171875 5.078125 30.65625 \n",
       "Q 7.421875 35.15625 12.890625 37.890625 \n",
       "Q 8.203125 40.625 6.640625 43.9375 \n",
       "Q 5.078125 47.265625 4.875 51.5625 \n",
       "Q 4.6875 55.859375 6.046875 58.984375 \n",
       "Q 7.421875 62.109375 10.15625 64.84375 \n",
       "Q 12.890625 67.578125 16.203125 68.546875 \n",
       "Q 19.53125 69.53125 23.4375 69.53125 \n",
       "Q 27.34375 69.53125 30.46875 68.75 \n",
       "Q 33.59375 67.96875 37.109375 65.421875 \n",
       "Q 40.625 62.890625 42.1875 58.203125 \n",
       "Q 43.75 53.515625 41.984375 47.265625 \n",
       "Q 40.234375 41.015625 32.8125 37.5 \n",
       "Q 39.453125 35.546875 42.1875 31.4375 \n",
       "Q 44.921875 27.34375 44.921875 21.484375 \n",
       "Q 44.921875 15.625 43.15625 12.109375 \n",
       "Q 41.40625 8.59375 39.25 6.25 \n",
       "Q 37.109375 3.90625 33.390625 2.53125 \n",
       "Q 29.6875 1.171875 24.015625 1.171875 \n",
       "Q 18.359375 1.171875 14.25 2.53125 \n",
       "Q 10.15625 3.90625 7.421875 6.640625 \n",
       "Q 4.6875 9.375 3.703125 13.078125 \n",
       "Q 2.734375 16.796875 2.734375 26.171875 \n",
       "z\n",
       "M 10.9375 26.5625 \n",
       "Q 10.546875 17.1875 12.296875 13.671875 \n",
       "Q 14.0625 10.15625 18.75 9.171875 \n",
       "Q 23.4375 8.203125 28.515625 9.375 \n",
       "Q 33.59375 10.546875 35.546875 14.84375 \n",
       "Q 37.5 19.140625 36.90625 23.4375 \n",
       "Q 36.328125 27.734375 32.03125 30.65625 \n",
       "Q 27.734375 33.59375 22.65625 33.203125 \n",
       "Q 17.578125 32.8125 14.25 29.6875 \n",
       "Q 10.9375 26.5625 10.546875 17.1875 \n",
       "z\n",
       "M 12.109375 56.25 \n",
       "Q 12.109375 48.4375 14.84375 44.921875 \n",
       "Q 17.578125 41.40625 23.4375 41.40625 \n",
       "Q 29.296875 41.40625 32.21875 44.921875 \n",
       "Q 35.15625 48.4375 34.953125 53.3125 \n",
       "Q 34.765625 58.203125 31.4375 60.546875 \n",
       "Q 28.125 62.890625 22.453125 62.5 \n",
       "Q 16.796875 62.109375 14.453125 59.171875 \n",
       "Q 12.109375 56.25 12.109375 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-56\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(71.34 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-56\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"118.48\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 10 -->\n",
       "      <defs>\n",
       "       <path d=\"M 21.875 56.25 \n",
       "Q 16.796875 51.171875 8.984375 46.484375 \n",
       "L 8.984375 53.90625 \n",
       "Q 18.75 60.546875 25 69.53125 \n",
       "L 29.6875 69.53125 \n",
       "L 29.6875 2.34375 \n",
       "L 21.875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-49\"/>\n",
       "       <path d=\"M 3.125 29.296875 \n",
       "Q 3.90625 50 6.4375 56.046875 \n",
       "Q 8.984375 62.109375 13.671875 66.015625 \n",
       "Q 18.359375 69.921875 25.1875 69.921875 \n",
       "Q 32.03125 69.921875 37.109375 64.25 \n",
       "Q 42.1875 58.59375 43.75 50 \n",
       "Q 45.3125 41.40625 44.71875 30.265625 \n",
       "Q 44.140625 19.140625 40.8125 12.109375 \n",
       "Q 37.5 5.078125 30.859375 2.34375 \n",
       "Q 24.21875 -0.390625 17.578125 2.921875 \n",
       "Q 10.9375 6.25 8.203125 11.71875 \n",
       "Q 5.46875 17.1875 4.296875 23.234375 \n",
       "Q 3.125 29.296875 3.90625 50 \n",
       "z\n",
       "M 12.890625 52.734375 \n",
       "Q 10.546875 31.25 12.5 22.84375 \n",
       "Q 14.453125 14.453125 18.9375 10.9375 \n",
       "Q 23.4375 7.421875 28.125 9.5625 \n",
       "Q 32.8125 11.71875 34.953125 18.15625 \n",
       "Q 37.109375 24.609375 37.109375 32.21875 \n",
       "Q 37.109375 39.84375 36.515625 46.09375 \n",
       "Q 35.9375 52.34375 33 57.421875 \n",
       "Q 30.078125 62.5 25.1875 62.6875 \n",
       "Q 20.3125 62.890625 16.59375 57.8125 \n",
       "Q 12.890625 52.734375 10.546875 31.25 \n",
       "z\n",
       "\" id=\"SimHei-48\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(113.48 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.12\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 12 -->\n",
       "      <defs>\n",
       "       <path d=\"M 4.6875 3.90625 \n",
       "Q 5.078125 9.765625 10.15625 14.453125 \n",
       "Q 15.234375 19.140625 23.046875 29.09375 \n",
       "Q 30.859375 39.0625 33.203125 44.53125 \n",
       "Q 35.546875 50 34.953125 53.90625 \n",
       "Q 34.375 57.8125 31.25 60.34375 \n",
       "Q 28.125 62.890625 24.015625 62.5 \n",
       "Q 19.921875 62.109375 16.203125 59.375 \n",
       "Q 12.5 56.640625 10.546875 51.171875 \n",
       "L 3.125 52.34375 \n",
       "Q 6.25 61.328125 11.125 65.421875 \n",
       "Q 16.015625 69.53125 22.65625 69.921875 \n",
       "Q 26.5625 70.3125 29.6875 69.71875 \n",
       "Q 32.8125 69.140625 36.125 66.984375 \n",
       "Q 39.453125 64.84375 41.59375 60.546875 \n",
       "Q 43.75 56.25 43.15625 50.1875 \n",
       "Q 42.578125 44.140625 37.109375 35.734375 \n",
       "Q 31.640625 27.34375 16.015625 9.375 \n",
       "L 44.140625 9.375 \n",
       "L 44.140625 2.34375 \n",
       "L 4.6875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-50\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(158.12 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-50\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"207.76\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 14 -->\n",
       "      <defs>\n",
       "       <path d=\"M 31.25 17.1875 \n",
       "L 1.171875 17.1875 \n",
       "L 1.171875 23.828125 \n",
       "L 32.8125 69.53125 \n",
       "L 38.671875 69.53125 \n",
       "L 38.671875 23.828125 \n",
       "L 48.046875 23.828125 \n",
       "L 48.046875 17.1875 \n",
       "L 38.671875 17.1875 \n",
       "L 38.671875 2.34375 \n",
       "L 31.25 2.34375 \n",
       "z\n",
       "M 31.25 23.828125 \n",
       "L 31.25 54.6875 \n",
       "L 9.375 23.828125 \n",
       "z\n",
       "\" id=\"SimHei-52\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(202.76 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-52\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"252.4\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 16 -->\n",
       "      <g transform=\"translate(247.4 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-54\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"297.04\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 18 -->\n",
       "      <g transform=\"translate(292.04 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-56\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"341.68\" xlink:href=\"#m7f3bbb2f2b\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(336.68 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_9\">\n",
       "     <!-- 小时 -->\n",
       "     <defs>\n",
       "      <path d=\"M 54.6875 80.46875 \n",
       "Q 54.296875 75 54.296875 65.625 \n",
       "L 54.296875 2.734375 \n",
       "Q 54.296875 -4.6875 50.390625 -6.640625 \n",
       "Q 46.484375 -8.59375 37.109375 -9.375 \n",
       "Q 36.328125 -4.6875 33.59375 -0.390625 \n",
       "Q 42.1875 -0.390625 44.328125 0 \n",
       "Q 46.484375 0.390625 46.484375 4.6875 \n",
       "L 46.484375 65.625 \n",
       "Q 46.484375 72.65625 46.09375 80.46875 \n",
       "L 54.6875 80.46875 \n",
       "z\n",
       "M 32.421875 53.125 \n",
       "Q 28.90625 43.359375 24.21875 30.65625 \n",
       "Q 19.53125 17.96875 16.015625 11.71875 \n",
       "Q 12.109375 14.84375 7.8125 15.625 \n",
       "Q 14.453125 27.34375 18.359375 38.859375 \n",
       "Q 22.265625 50.390625 23.4375 55.859375 \n",
       "Q 28.125 53.515625 32.421875 53.125 \n",
       "z\n",
       "M 73.046875 56.25 \n",
       "Q 88.671875 28.125 91.796875 17.96875 \n",
       "Q 87.890625 17.1875 83.984375 14.453125 \n",
       "Q 78.125 31.25 66.015625 51.953125 \n",
       "Q 69.140625 53.515625 73.046875 56.25 \n",
       "z\n",
       "\" id=\"SimHei-23567\"/>\n",
       "      <path d=\"M 39.453125 71.484375 \n",
       "Q 39.0625 57.421875 39.0625 37.5 \n",
       "Q 39.0625 17.578125 39.453125 6.25 \n",
       "L 31.25 6.25 \n",
       "L 31.25 13.671875 \n",
       "L 15.625 13.671875 \n",
       "L 15.625 0.78125 \n",
       "L 7.421875 0.78125 \n",
       "Q 7.8125 18.75 7.8125 36.71875 \n",
       "Q 7.8125 55.078125 7.421875 71.484375 \n",
       "L 39.453125 71.484375 \n",
       "z\n",
       "M 76.171875 59.765625 \n",
       "Q 76.171875 71.484375 75.78125 81.640625 \n",
       "L 84.375 81.640625 \n",
       "Q 83.984375 71.484375 83.984375 59.765625 \n",
       "Q 89.84375 59.765625 96.484375 60.15625 \n",
       "L 96.484375 52.734375 \n",
       "Q 89.84375 53.125 83.984375 53.125 \n",
       "L 83.984375 0.78125 \n",
       "Q 83.984375 -5.078125 79.296875 -6.640625 \n",
       "Q 74.609375 -8.203125 67.1875 -8.984375 \n",
       "Q 67.1875 -4.296875 62.890625 0 \n",
       "Q 70.3125 -0.78125 73.234375 -0.390625 \n",
       "Q 76.171875 0 76.171875 4.6875 \n",
       "L 76.171875 53.125 \n",
       "Q 56.640625 53.125 43.359375 52.734375 \n",
       "L 43.359375 60.15625 \n",
       "Q 55.859375 59.765625 76.171875 59.765625 \n",
       "z\n",
       "M 31.25 20.3125 \n",
       "L 31.25 39.84375 \n",
       "L 15.625 39.84375 \n",
       "L 15.625 20.3125 \n",
       "z\n",
       "M 31.25 46.484375 \n",
       "L 31.25 64.84375 \n",
       "L 15.625 64.84375 \n",
       "L 15.625 46.484375 \n",
       "z\n",
       "M 55.46875 42.578125 \n",
       "Q 60.546875 34.375 65.234375 25 \n",
       "Q 61.328125 23.828125 57.03125 21.484375 \n",
       "Q 53.90625 30.859375 48.046875 39.0625 \n",
       "Q 51.5625 40.625 55.46875 42.578125 \n",
       "z\n",
       "\" id=\"SimHei-26102\"/>\n",
       "     </defs>\n",
       "     <g transform=\"translate(186.6 251.616562)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#SimHei-23567\"/>\n",
       "      <use x=\"100\" xlink:href=\"#SimHei-26102\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m087efb856e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"201.217136\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(12.2 204.654636)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"174.13868\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 40 -->\n",
       "      <g transform=\"translate(12.2 177.57618)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-52\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"147.060224\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 60 -->\n",
       "      <g transform=\"translate(12.2 150.497724)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"119.981768\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 80 -->\n",
       "      <g transform=\"translate(12.2 123.419268)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-56\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"92.903313\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 100 -->\n",
       "      <g transform=\"translate(7.2 96.340813)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"65.824857\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 120 -->\n",
       "      <g transform=\"translate(7.2 69.262357)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"38.746401\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 140 -->\n",
       "      <g transform=\"translate(7.2 42.183901)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-52\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"29.2\" xlink:href=\"#m087efb856e\" y=\"11.667945\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_17\">\n",
       "      <!-- 160 -->\n",
       "      <g transform=\"translate(7.2 15.105445)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_17\">\n",
       "    <path clip-path=\"url(#pa13c97d22c)\" d=\"M 29.2 214.756364 \n",
       "L 51.52 178.200448 \n",
       "L 73.84 84.779776 \n",
       "L 96.16 17.083636 \n",
       "L 118.48 34.684633 \n",
       "L 140.8 142.998456 \n",
       "L 185.44 187.677908 \n",
       "L 207.76 179.554371 \n",
       "L 230.08 205.278904 \n",
       "L 252.4 160.599452 \n",
       "L 274.72 129.459228 \n",
       "L 297.04 132.167073 \n",
       "L 319.36 132.167073 \n",
       "L 341.68 175.492603 \n",
       "L 364 206.632827 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 29.2 224.64 \n",
       "L 29.2 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 364 224.64 \n",
       "L 364 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 29.2 224.64 \n",
       "L 364 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 29.2 7.2 \n",
       "L 364 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pa13c97d22c\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"29.2\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 利用自定义时间格式函数strftime提取小时数\n",
    "data['小时'] = data['成交时间'].map(lambda x:int(x.strftime('%H')))\n",
    "# 对小时和订单去重\n",
    "traffic = data[['小时', '订单ID']].drop_duplicates()\n",
    "# 求每小时的客流量\n",
    "traffic.groupby('小时')['订单ID'].count().plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 四、假如你是某银行的数据分析师\n",
    "加入你是某银行的数据分析师，坏账率是你日常关注的重点指标，坏账率受哪些因素的影响呢？现有一份历史人员借款表。分析一下受哪些因素影响\n",
    "\n",
    "注：坏账率：所有借款用户中逾期不还用户的占比，逾期不还用户好坏客户字段标记为1，反之标记为0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>用户ID</th>\n",
       "      <th>好坏客户</th>\n",
       "      <th>年龄</th>\n",
       "      <th>负债率</th>\n",
       "      <th>月收入</th>\n",
       "      <th>家属数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>45</td>\n",
       "      <td>0.802982</td>\n",
       "      <td>9120.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>0.121876</td>\n",
       "      <td>2600.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>38</td>\n",
       "      <td>0.085113</td>\n",
       "      <td>3042.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>0.036050</td>\n",
       "      <td>3300.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>49</td>\n",
       "      <td>0.024926</td>\n",
       "      <td>63588.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   用户ID  好坏客户  年龄       负债率      月收入  家属数量\n",
       "0     1     1  45  0.802982   9120.0   2.0\n",
       "1     2     0  40  0.121876   2600.0   1.0\n",
       "2     3     0  38  0.085113   3042.0   0.0\n",
       "3     4     0  30  0.036050   3300.0   0.0\n",
       "4     5     0  49  0.024926  63588.0   0.0"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 150000 entries, 0 to 149999\n",
      "Data columns (total 6 columns):\n",
      "用户ID    150000 non-null int64\n",
      "好坏客户    150000 non-null int64\n",
      "年龄      150000 non-null int64\n",
      "负债率     150000 non-null float64\n",
      "月收入     120269 non-null float64\n",
      "家属数量    146076 non-null float64\n",
      "dtypes: float64(3), int64(3)\n",
      "memory usage: 6.9 MB\n"
     ]
    }
   ],
   "source": [
    "data = pd.read_csv('./data/loan.csv', encoding='gbk')\n",
    "data.head()\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4.1 是不是收入越高的人坏账率越低？\n",
    "按理说收入越高，越不缺钱，坏账率应该越低，是不是这样的呢？\n",
    "\n",
    "收入的缺失值处理，使用均值来填充"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 150000 entries, 0 to 149999\n",
      "Data columns (total 6 columns):\n",
      "用户ID    150000 non-null int64\n",
      "好坏客户    150000 non-null int64\n",
      "年龄      150000 non-null int64\n",
      "负债率     150000 non-null float64\n",
      "月收入     150000 non-null float64\n",
      "家属数量    146076 non-null float64\n",
      "dtypes: float64(3), int64(3)\n",
      "memory usage: 6.9 MB\n"
     ]
    }
   ],
   "source": [
    "data = data.fillna({'月收入': data['月收入'].mean()})\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0           (5000, 10000]\n",
       "1               (0, 5000]\n",
       "2               (0, 5000]\n",
       "3               (0, 5000]\n",
       "4         (20000, 100000]\n",
       "               ...       \n",
       "149995          (0, 5000]\n",
       "149996      (5000, 10000]\n",
       "149997      (5000, 10000]\n",
       "149998      (5000, 10000]\n",
       "149999      (5000, 10000]\n",
       "Name: 月收入, Length: 150000, dtype: category\n",
       "Categories (5, interval[int64]): [(0, 5000] < (5000, 10000] < (10000, 15000] < (15000, 20000] < (20000, 100000]]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 因为月收入属于连续值，对于连续值进行分析时，一般会将连续值离散化，即将连续值进行区间划分，分成若干个类\n",
    "cut_bins = [0, 5000, 10000, 15000, 20000, 100000]\n",
    "income_cut = pd.cut(data['月收入'], cut_bins)\n",
    "income_cut"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "月收入\n",
       "(0, 5000]          0.087543\n",
       "(5000, 10000]      0.058308\n",
       "(10000, 15000]     0.041964\n",
       "(15000, 20000]     0.041811\n",
       "(20000, 100000]    0.053615\n",
       "Name: 好坏客户, dtype: float64"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_income_user = data['好坏客户'].groupby(income_cut).count()\n",
    "bad_income_user = data['好坏客户'].groupby(income_cut).sum()\n",
    "bad_rate = bad_income_user / all_income_user\n",
    "bad_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x11f0a89d0>"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"327.019688pt\" version=\"1.1\" viewBox=\"0 0 376.2 327.019688\" width=\"376.2pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 327.019688 \n",
       "L 376.2 327.019688 \n",
       "L 376.2 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "L 369 7.2 \n",
       "L 34.2 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#p5e519ffe02)\" d=\"M 50.94 224.64 \n",
       "L 84.42 224.64 \n",
       "L 84.42 17.554286 \n",
       "L 50.94 17.554286 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#p5e519ffe02)\" d=\"M 117.9 224.64 \n",
       "L 151.38 224.64 \n",
       "L 151.38 86.710949 \n",
       "L 117.9 86.710949 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#p5e519ffe02)\" d=\"M 184.86 224.64 \n",
       "L 218.34 224.64 \n",
       "L 218.34 125.372574 \n",
       "L 184.86 125.372574 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#p5e519ffe02)\" d=\"M 251.82 224.64 \n",
       "L 285.3 224.64 \n",
       "L 285.3 125.734956 \n",
       "L 251.82 125.734956 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#p5e519ffe02)\" d=\"M 318.78 224.64 \n",
       "L 352.26 224.64 \n",
       "L 352.26 97.810702 \n",
       "L 318.78 97.810702 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m9b22ff679d\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"67.68\" xlink:href=\"#m9b22ff679d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- (0, 5000] -->\n",
       "      <defs>\n",
       "       <path d=\"M 46.484375 -3.125 \n",
       "L 42.1875 -7.421875 \n",
       "Q 32.421875 1.953125 27.53125 12.109375 \n",
       "Q 22.65625 22.265625 22.65625 35.15625 \n",
       "Q 22.65625 48.046875 27.53125 58.203125 \n",
       "Q 32.421875 68.359375 42.1875 78.125 \n",
       "L 46.484375 73.828125 \n",
       "Q 37.5 65.234375 33 56.046875 \n",
       "Q 28.515625 46.875 28.515625 35.15625 \n",
       "Q 28.515625 23.4375 33 14.25 \n",
       "Q 37.5 5.078125 46.484375 -3.125 \n",
       "z\n",
       "\" id=\"SimHei-40\"/>\n",
       "       <path d=\"M 3.125 29.296875 \n",
       "Q 3.90625 50 6.4375 56.046875 \n",
       "Q 8.984375 62.109375 13.671875 66.015625 \n",
       "Q 18.359375 69.921875 25.1875 69.921875 \n",
       "Q 32.03125 69.921875 37.109375 64.25 \n",
       "Q 42.1875 58.59375 43.75 50 \n",
       "Q 45.3125 41.40625 44.71875 30.265625 \n",
       "Q 44.140625 19.140625 40.8125 12.109375 \n",
       "Q 37.5 5.078125 30.859375 2.34375 \n",
       "Q 24.21875 -0.390625 17.578125 2.921875 \n",
       "Q 10.9375 6.25 8.203125 11.71875 \n",
       "Q 5.46875 17.1875 4.296875 23.234375 \n",
       "Q 3.125 29.296875 3.90625 50 \n",
       "z\n",
       "M 12.890625 52.734375 \n",
       "Q 10.546875 31.25 12.5 22.84375 \n",
       "Q 14.453125 14.453125 18.9375 10.9375 \n",
       "Q 23.4375 7.421875 28.125 9.5625 \n",
       "Q 32.8125 11.71875 34.953125 18.15625 \n",
       "Q 37.109375 24.609375 37.109375 32.21875 \n",
       "Q 37.109375 39.84375 36.515625 46.09375 \n",
       "Q 35.9375 52.34375 33 57.421875 \n",
       "Q 30.078125 62.5 25.1875 62.6875 \n",
       "Q 20.3125 62.890625 16.59375 57.8125 \n",
       "Q 12.890625 52.734375 10.546875 31.25 \n",
       "z\n",
       "\" id=\"SimHei-48\"/>\n",
       "       <path d=\"M 17.1875 1.953125 \n",
       "L 12.109375 -8.59375 \n",
       "L 8.203125 -8.59375 \n",
       "L 12.109375 1.953125 \n",
       "L 8.203125 1.953125 \n",
       "L 8.203125 10.546875 \n",
       "L 17.1875 10.546875 \n",
       "z\n",
       "\" id=\"SimHei-44\"/>\n",
       "       <path id=\"SimHei-32\"/>\n",
       "       <path d=\"M 8.59375 20.703125 \n",
       "Q 11.328125 10.15625 17.96875 8.984375 \n",
       "Q 24.609375 7.8125 28.703125 10.34375 \n",
       "Q 32.8125 12.890625 34.5625 16.984375 \n",
       "Q 36.328125 21.09375 36.125 26.171875 \n",
       "Q 35.9375 31.25 33.390625 34.765625 \n",
       "Q 30.859375 38.28125 26.953125 39.453125 \n",
       "Q 23.046875 40.625 18.15625 39.453125 \n",
       "Q 13.28125 38.28125 10.15625 33.984375 \n",
       "L 3.515625 34.765625 \n",
       "Q 4.296875 37.109375 10.9375 68.359375 \n",
       "L 41.796875 68.359375 \n",
       "L 41.796875 61.328125 \n",
       "L 16.796875 61.328125 \n",
       "Q 14.84375 50.78125 12.890625 44.53125 \n",
       "Q 18.75 47.265625 23.828125 47.0625 \n",
       "Q 28.90625 46.875 33.59375 44.71875 \n",
       "Q 38.28125 42.578125 40.421875 38.859375 \n",
       "Q 42.578125 35.15625 43.546875 31.4375 \n",
       "Q 44.53125 27.734375 44.328125 23.4375 \n",
       "Q 44.140625 19.140625 42.578125 14.640625 \n",
       "Q 41.015625 10.15625 37.890625 7.21875 \n",
       "Q 34.765625 4.296875 30.265625 2.53125 \n",
       "Q 25.78125 0.78125 19.921875 1.171875 \n",
       "Q 14.0625 1.5625 8.78125 5.46875 \n",
       "Q 3.515625 9.375 1.5625 18.75 \n",
       "z\n",
       "\" id=\"SimHei-53\"/>\n",
       "       <path d=\"M 29.296875 -8.203125 \n",
       "L 4.6875 -8.203125 \n",
       "L 4.6875 -1.953125 \n",
       "L 22.65625 -1.953125 \n",
       "L 22.65625 72.65625 \n",
       "L 4.6875 72.65625 \n",
       "L 4.6875 78.90625 \n",
       "L 29.296875 78.90625 \n",
       "z\n",
       "\" id=\"SimHei-93\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(70.805 276.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"134.64\" xlink:href=\"#m9b22ff679d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- (5000, 10000] -->\n",
       "      <defs>\n",
       "       <path d=\"M 21.875 56.25 \n",
       "Q 16.796875 51.171875 8.984375 46.484375 \n",
       "L 8.984375 53.90625 \n",
       "Q 18.75 60.546875 25 69.53125 \n",
       "L 29.6875 69.53125 \n",
       "L 29.6875 2.34375 \n",
       "L 21.875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-49\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(137.765 296.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"201.6\" xlink:href=\"#m9b22ff679d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- (10000, 15000] -->\n",
       "      <g transform=\"translate(204.725 301.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"268.56\" xlink:href=\"#m9b22ff679d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- (15000, 20000] -->\n",
       "      <defs>\n",
       "       <path d=\"M 4.6875 3.90625 \n",
       "Q 5.078125 9.765625 10.15625 14.453125 \n",
       "Q 15.234375 19.140625 23.046875 29.09375 \n",
       "Q 30.859375 39.0625 33.203125 44.53125 \n",
       "Q 35.546875 50 34.953125 53.90625 \n",
       "Q 34.375 57.8125 31.25 60.34375 \n",
       "Q 28.125 62.890625 24.015625 62.5 \n",
       "Q 19.921875 62.109375 16.203125 59.375 \n",
       "Q 12.5 56.640625 10.546875 51.171875 \n",
       "L 3.125 52.34375 \n",
       "Q 6.25 61.328125 11.125 65.421875 \n",
       "Q 16.015625 69.53125 22.65625 69.921875 \n",
       "Q 26.5625 70.3125 29.6875 69.71875 \n",
       "Q 32.8125 69.140625 36.125 66.984375 \n",
       "Q 39.453125 64.84375 41.59375 60.546875 \n",
       "Q 43.75 56.25 43.15625 50.1875 \n",
       "Q 42.578125 44.140625 37.109375 35.734375 \n",
       "Q 31.640625 27.34375 16.015625 9.375 \n",
       "L 44.140625 9.375 \n",
       "L 44.140625 2.34375 \n",
       "L 4.6875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-50\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(271.685 301.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"335.52\" xlink:href=\"#m9b22ff679d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- (20000, 100000] -->\n",
       "      <g transform=\"translate(338.645 306.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"700\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- 月收入 -->\n",
       "     <defs>\n",
       "      <path d=\"M 82.03125 75.390625 \n",
       "Q 81.25 66.015625 81.25 58.59375 \n",
       "L 81.25 3.125 \n",
       "Q 81.25 -4.296875 77.34375 -5.859375 \n",
       "Q 73.4375 -7.421875 62.109375 -8.203125 \n",
       "Q 61.328125 -3.515625 58.59375 0.78125 \n",
       "Q 67.1875 0.390625 70.5 0.78125 \n",
       "Q 73.828125 1.171875 73.828125 6.25 \n",
       "L 73.828125 25 \n",
       "L 28.90625 25 \n",
       "Q 26.953125 12.109375 22.65625 3.515625 \n",
       "Q 18.359375 -5.078125 14.0625 -8.984375 \n",
       "Q 10.9375 -6.25 6.25 -5.078125 \n",
       "Q 12.5 0.390625 16.203125 8 \n",
       "Q 19.921875 15.625 20.890625 23.046875 \n",
       "Q 21.875 30.46875 21.875 39.453125 \n",
       "L 21.875 56.640625 \n",
       "Q 21.875 65.234375 21.484375 75.390625 \n",
       "L 82.03125 75.390625 \n",
       "z\n",
       "M 73.828125 53.125 \n",
       "L 73.828125 69.53125 \n",
       "L 29.296875 69.53125 \n",
       "L 29.296875 53.125 \n",
       "z\n",
       "M 73.828125 31.25 \n",
       "L 73.828125 47.265625 \n",
       "L 29.296875 47.265625 \n",
       "L 29.296875 31.25 \n",
       "z\n",
       "\" id=\"SimHei-26376\"/>\n",
       "      <path d=\"M 66.40625 78.90625 \n",
       "Q 64.453125 75.78125 58.59375 63.28125 \n",
       "L 80.46875 63.28125 \n",
       "Q 88.671875 63.28125 95.703125 63.671875 \n",
       "L 95.703125 56.25 \n",
       "Q 88.671875 56.640625 82.8125 56.640625 \n",
       "Q 81.640625 41.015625 78.515625 30.859375 \n",
       "Q 75.390625 20.703125 71.484375 14.0625 \n",
       "Q 76.5625 7.8125 82.609375 4.296875 \n",
       "Q 88.671875 0.78125 96.875 -1.171875 \n",
       "Q 92.1875 -4.296875 90.625 -8.59375 \n",
       "Q 82.8125 -5.46875 77.34375 -1.5625 \n",
       "Q 71.875 2.34375 66.796875 8.203125 \n",
       "Q 59.375 0 43.359375 -9.765625 \n",
       "Q 41.40625 -6.640625 35.9375 -3.515625 \n",
       "Q 51.171875 2.34375 61.71875 14.453125 \n",
       "Q 58.984375 20.703125 56.4375 27.921875 \n",
       "Q 53.90625 35.15625 50.78125 46.875 \n",
       "Q 46.484375 38.28125 44.140625 35.546875 \n",
       "Q 41.40625 37.5 37.890625 39.453125 \n",
       "Q 43.359375 47.265625 49.015625 59.953125 \n",
       "Q 54.6875 72.65625 56.640625 82.03125 \n",
       "Q 61.328125 80.078125 66.40625 78.90625 \n",
       "z\n",
       "M 15.234375 66.796875 \n",
       "Q 14.453125 61.71875 14.453125 53.90625 \n",
       "L 14.453125 24.609375 \n",
       "L 27.734375 26.953125 \n",
       "L 27.734375 69.140625 \n",
       "Q 27.734375 74.609375 27.34375 80.46875 \n",
       "L 35.15625 80.46875 \n",
       "Q 34.765625 75.78125 34.765625 69.53125 \n",
       "L 34.765625 4.6875 \n",
       "Q 34.765625 -0.78125 35.15625 -8.59375 \n",
       "L 27.34375 -8.59375 \n",
       "Q 27.734375 -0.390625 27.734375 5.46875 \n",
       "L 27.734375 21.09375 \n",
       "Q 9.765625 16.40625 7.8125 14.453125 \n",
       "Q 5.859375 17.578125 3.515625 21.09375 \n",
       "Q 7.03125 23.046875 7.03125 28.125 \n",
       "L 7.03125 55.859375 \n",
       "Q 7.03125 61.328125 6.640625 66.796875 \n",
       "L 15.234375 66.796875 \n",
       "z\n",
       "M 58.203125 49.21875 \n",
       "Q 59.375 42.1875 61.90625 34.5625 \n",
       "Q 64.453125 26.953125 67.1875 21.484375 \n",
       "Q 73.828125 33.59375 75.390625 56.640625 \n",
       "L 55.859375 56.640625 \n",
       "Q 53.125 51.171875 51.5625 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-25910\"/>\n",
       "      <path d=\"M 88.28125 -5.859375 \n",
       "Q 78.90625 0.390625 70.3125 10.15625 \n",
       "Q 61.71875 19.921875 51.171875 47.65625 \n",
       "Q 40.234375 15.234375 10.546875 -7.421875 \n",
       "Q 8.984375 -3.515625 3.515625 0.78125 \n",
       "Q 28.90625 12.890625 46.484375 55.078125 \n",
       "Q 45.3125 58.203125 39.453125 64.453125 \n",
       "Q 33.59375 70.703125 27.34375 73.046875 \n",
       "Q 31.640625 76.5625 33.984375 80.078125 \n",
       "Q 43.75 72.65625 49.609375 66.015625 \n",
       "Q 55.46875 59.375 64.453125 37.109375 \n",
       "Q 73.4375 14.84375 95.703125 3.90625 \n",
       "Q 90.234375 0 88.28125 -5.859375 \n",
       "z\n",
       "\" id=\"SimHei-20837\"/>\n",
       "     </defs>\n",
       "     <g transform=\"translate(186.6 318.569688)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#SimHei-26376\"/>\n",
       "      <use x=\"100\" xlink:href=\"#SimHei-25910\"/>\n",
       "      <use x=\"200\" xlink:href=\"#SimHei-20837\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m5d47a49e25\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m5d47a49e25\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.00 -->\n",
       "      <defs>\n",
       "       <path d=\"M 16.796875 1.953125 \n",
       "L 7.8125 1.953125 \n",
       "L 7.8125 10.546875 \n",
       "L 16.796875 10.546875 \n",
       "z\n",
       "\" id=\"SimHei-46\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 228.0775)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m5d47a49e25\" y=\"177.329181\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 0.02 -->\n",
       "      <g transform=\"translate(7.2 180.766681)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-50\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m5d47a49e25\" y=\"130.018362\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0.04 -->\n",
       "      <defs>\n",
       "       <path d=\"M 31.25 17.1875 \n",
       "L 1.171875 17.1875 \n",
       "L 1.171875 23.828125 \n",
       "L 32.8125 69.53125 \n",
       "L 38.671875 69.53125 \n",
       "L 38.671875 23.828125 \n",
       "L 48.046875 23.828125 \n",
       "L 48.046875 17.1875 \n",
       "L 38.671875 17.1875 \n",
       "L 38.671875 2.34375 \n",
       "L 31.25 2.34375 \n",
       "z\n",
       "M 31.25 23.828125 \n",
       "L 31.25 54.6875 \n",
       "L 9.375 23.828125 \n",
       "z\n",
       "\" id=\"SimHei-52\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 133.455862)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-52\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m5d47a49e25\" y=\"82.707543\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 0.06 -->\n",
       "      <defs>\n",
       "       <path d=\"M 3.515625 19.53125 \n",
       "Q 4.296875 30.859375 6.046875 34.765625 \n",
       "Q 7.8125 38.671875 11.328125 44.53125 \n",
       "L 27.34375 69.53125 \n",
       "L 36.328125 69.53125 \n",
       "L 19.921875 43.75 \n",
       "Q 30.46875 46.484375 36.71875 42.96875 \n",
       "Q 42.96875 39.453125 45.109375 34.953125 \n",
       "Q 47.265625 30.46875 47.453125 25.1875 \n",
       "Q 47.65625 19.921875 45.890625 14.84375 \n",
       "Q 44.140625 9.765625 39.640625 5.65625 \n",
       "Q 35.15625 1.5625 27.140625 1.171875 \n",
       "Q 19.140625 0.78125 13.46875 4.09375 \n",
       "Q 7.8125 7.421875 5.65625 13.46875 \n",
       "Q 3.515625 19.53125 4.296875 30.859375 \n",
       "z\n",
       "M 12.5 16.015625 \n",
       "Q 19.53125 8.59375 25.390625 8.203125 \n",
       "Q 31.25 7.8125 35.15625 12.109375 \n",
       "Q 39.0625 16.40625 39.0625 24.609375 \n",
       "Q 39.0625 32.8125 34.171875 35.9375 \n",
       "Q 29.296875 39.0625 23.234375 38.28125 \n",
       "Q 17.1875 37.5 14.453125 32.421875 \n",
       "Q 11.71875 27.34375 12.109375 21.671875 \n",
       "Q 12.5 16.015625 19.53125 8.59375 \n",
       "z\n",
       "\" id=\"SimHei-54\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 86.145043)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-54\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m5d47a49e25\" y=\"35.396725\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0.08 -->\n",
       "      <defs>\n",
       "       <path d=\"M 2.734375 16.796875 \n",
       "Q 2.734375 26.171875 5.078125 30.65625 \n",
       "Q 7.421875 35.15625 12.890625 37.890625 \n",
       "Q 8.203125 40.625 6.640625 43.9375 \n",
       "Q 5.078125 47.265625 4.875 51.5625 \n",
       "Q 4.6875 55.859375 6.046875 58.984375 \n",
       "Q 7.421875 62.109375 10.15625 64.84375 \n",
       "Q 12.890625 67.578125 16.203125 68.546875 \n",
       "Q 19.53125 69.53125 23.4375 69.53125 \n",
       "Q 27.34375 69.53125 30.46875 68.75 \n",
       "Q 33.59375 67.96875 37.109375 65.421875 \n",
       "Q 40.625 62.890625 42.1875 58.203125 \n",
       "Q 43.75 53.515625 41.984375 47.265625 \n",
       "Q 40.234375 41.015625 32.8125 37.5 \n",
       "Q 39.453125 35.546875 42.1875 31.4375 \n",
       "Q 44.921875 27.34375 44.921875 21.484375 \n",
       "Q 44.921875 15.625 43.15625 12.109375 \n",
       "Q 41.40625 8.59375 39.25 6.25 \n",
       "Q 37.109375 3.90625 33.390625 2.53125 \n",
       "Q 29.6875 1.171875 24.015625 1.171875 \n",
       "Q 18.359375 1.171875 14.25 2.53125 \n",
       "Q 10.15625 3.90625 7.421875 6.640625 \n",
       "Q 4.6875 9.375 3.703125 13.078125 \n",
       "Q 2.734375 16.796875 2.734375 26.171875 \n",
       "z\n",
       "M 10.9375 26.5625 \n",
       "Q 10.546875 17.1875 12.296875 13.671875 \n",
       "Q 14.0625 10.15625 18.75 9.171875 \n",
       "Q 23.4375 8.203125 28.515625 9.375 \n",
       "Q 33.59375 10.546875 35.546875 14.84375 \n",
       "Q 37.5 19.140625 36.90625 23.4375 \n",
       "Q 36.328125 27.734375 32.03125 30.65625 \n",
       "Q 27.734375 33.59375 22.65625 33.203125 \n",
       "Q 17.578125 32.8125 14.25 29.6875 \n",
       "Q 10.9375 26.5625 10.546875 17.1875 \n",
       "z\n",
       "M 12.109375 56.25 \n",
       "Q 12.109375 48.4375 14.84375 44.921875 \n",
       "Q 17.578125 41.40625 23.4375 41.40625 \n",
       "Q 29.296875 41.40625 32.21875 44.921875 \n",
       "Q 35.15625 48.4375 34.953125 53.3125 \n",
       "Q 34.765625 58.203125 31.4375 60.546875 \n",
       "Q 28.125 62.890625 22.453125 62.5 \n",
       "Q 16.796875 62.109375 14.453125 59.171875 \n",
       "Q 12.109375 56.25 12.109375 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-56\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 38.834225)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-56\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 34.2 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 369 224.64 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_11\">\n",
       "    <path d=\"M 34.2 7.2 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p5e519ffe02\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"34.2\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "bad_rate.plot.bar()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4.2 年龄和坏账率有什么关系？\n",
    "是不是年龄越大越理性，对信用越看重，坏账率更低呢？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "年龄\n",
       "(-0.109, 18.167]    0.000000\n",
       "(18.167, 36.333]    0.110124\n",
       "(36.333, 54.5]      0.081645\n",
       "(54.5, 72.667]      0.041719\n",
       "(72.667, 90.833]    0.021585\n",
       "(90.833, 109.0]     0.022495\n",
       "Name: 好坏客户, dtype: float64"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x11bb39e50>"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"332.05875pt\" version=\"1.1\" viewBox=\"0 0 376.2 332.05875\" width=\"376.2pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 332.05875 \n",
       "L 376.2 332.05875 \n",
       "L 376.2 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "L 369 7.2 \n",
       "L 34.2 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 48.15 224.64 \n",
       "L 76.05 224.64 \n",
       "L 76.05 224.64 \n",
       "L 48.15 224.64 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 103.95 224.64 \n",
       "L 131.85 224.64 \n",
       "L 131.85 17.554286 \n",
       "L 103.95 17.554286 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 159.75 224.64 \n",
       "L 187.65 224.64 \n",
       "L 187.65 71.108288 \n",
       "L 159.75 71.108288 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 215.55 224.64 \n",
       "L 243.45 224.64 \n",
       "L 243.45 146.188621 \n",
       "L 215.55 146.188621 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 271.35 224.64 \n",
       "L 299.25 224.64 \n",
       "L 299.25 184.049283 \n",
       "L 271.35 184.049283 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#p6bfce38553)\" d=\"M 327.15 224.64 \n",
       "L 355.05 224.64 \n",
       "L 355.05 182.338882 \n",
       "L 327.15 182.338882 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m5e79d39cd8\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"62.1\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- (-0.109, 18.167] -->\n",
       "      <defs>\n",
       "       <path d=\"M 46.484375 -3.125 \n",
       "L 42.1875 -7.421875 \n",
       "Q 32.421875 1.953125 27.53125 12.109375 \n",
       "Q 22.65625 22.265625 22.65625 35.15625 \n",
       "Q 22.65625 48.046875 27.53125 58.203125 \n",
       "Q 32.421875 68.359375 42.1875 78.125 \n",
       "L 46.484375 73.828125 \n",
       "Q 37.5 65.234375 33 56.046875 \n",
       "Q 28.515625 46.875 28.515625 35.15625 \n",
       "Q 28.515625 23.4375 33 14.25 \n",
       "Q 37.5 5.078125 46.484375 -3.125 \n",
       "z\n",
       "\" id=\"SimHei-40\"/>\n",
       "       <path d=\"M 46.484375 33.203125 \n",
       "L 1.953125 33.203125 \n",
       "L 1.953125 39.453125 \n",
       "L 46.484375 39.453125 \n",
       "z\n",
       "\" id=\"SimHei-45\"/>\n",
       "       <path d=\"M 3.125 29.296875 \n",
       "Q 3.90625 50 6.4375 56.046875 \n",
       "Q 8.984375 62.109375 13.671875 66.015625 \n",
       "Q 18.359375 69.921875 25.1875 69.921875 \n",
       "Q 32.03125 69.921875 37.109375 64.25 \n",
       "Q 42.1875 58.59375 43.75 50 \n",
       "Q 45.3125 41.40625 44.71875 30.265625 \n",
       "Q 44.140625 19.140625 40.8125 12.109375 \n",
       "Q 37.5 5.078125 30.859375 2.34375 \n",
       "Q 24.21875 -0.390625 17.578125 2.921875 \n",
       "Q 10.9375 6.25 8.203125 11.71875 \n",
       "Q 5.46875 17.1875 4.296875 23.234375 \n",
       "Q 3.125 29.296875 3.90625 50 \n",
       "z\n",
       "M 12.890625 52.734375 \n",
       "Q 10.546875 31.25 12.5 22.84375 \n",
       "Q 14.453125 14.453125 18.9375 10.9375 \n",
       "Q 23.4375 7.421875 28.125 9.5625 \n",
       "Q 32.8125 11.71875 34.953125 18.15625 \n",
       "Q 37.109375 24.609375 37.109375 32.21875 \n",
       "Q 37.109375 39.84375 36.515625 46.09375 \n",
       "Q 35.9375 52.34375 33 57.421875 \n",
       "Q 30.078125 62.5 25.1875 62.6875 \n",
       "Q 20.3125 62.890625 16.59375 57.8125 \n",
       "Q 12.890625 52.734375 10.546875 31.25 \n",
       "z\n",
       "\" id=\"SimHei-48\"/>\n",
       "       <path d=\"M 16.796875 1.953125 \n",
       "L 7.8125 1.953125 \n",
       "L 7.8125 10.546875 \n",
       "L 16.796875 10.546875 \n",
       "z\n",
       "\" id=\"SimHei-46\"/>\n",
       "       <path d=\"M 21.875 56.25 \n",
       "Q 16.796875 51.171875 8.984375 46.484375 \n",
       "L 8.984375 53.90625 \n",
       "Q 18.75 60.546875 25 69.53125 \n",
       "L 29.6875 69.53125 \n",
       "L 29.6875 2.34375 \n",
       "L 21.875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-49\"/>\n",
       "       <path d=\"M 12.5 1.171875 \n",
       "Q 21.09375 15.625 26.5625 27.34375 \n",
       "Q 16.796875 25.78125 10.34375 29.875 \n",
       "Q 3.90625 33.984375 2.53125 41.015625 \n",
       "Q 1.171875 48.046875 2.734375 53.703125 \n",
       "Q 4.296875 59.375 7.609375 63.078125 \n",
       "Q 10.9375 66.796875 15.625 68.359375 \n",
       "Q 20.3125 69.921875 24.015625 69.921875 \n",
       "Q 27.734375 69.921875 31.640625 68.359375 \n",
       "Q 35.546875 66.796875 38.671875 63.671875 \n",
       "Q 41.796875 60.546875 42.96875 57.21875 \n",
       "Q 44.140625 53.90625 44.140625 48.625 \n",
       "Q 44.140625 43.359375 40.234375 35.15625 \n",
       "Q 36.328125 26.953125 21.09375 1.171875 \n",
       "z\n",
       "M 9.765625 50 \n",
       "Q 10.9375 39.84375 14.640625 36.515625 \n",
       "Q 18.359375 33.203125 22.65625 33.59375 \n",
       "Q 26.953125 33.984375 29.484375 35.9375 \n",
       "Q 32.03125 37.890625 34.375 42.578125 \n",
       "Q 35.9375 48.4375 35.15625 52.53125 \n",
       "Q 34.375 56.640625 31.046875 59.375 \n",
       "Q 27.734375 62.109375 23.828125 62.109375 \n",
       "Q 21.484375 62.5 17.765625 60.9375 \n",
       "Q 14.0625 59.375 11.90625 54.6875 \n",
       "Q 9.765625 50 10.9375 39.84375 \n",
       "z\n",
       "\" id=\"SimHei-57\"/>\n",
       "       <path d=\"M 17.1875 1.953125 \n",
       "L 12.109375 -8.59375 \n",
       "L 8.203125 -8.59375 \n",
       "L 12.109375 1.953125 \n",
       "L 8.203125 1.953125 \n",
       "L 8.203125 10.546875 \n",
       "L 17.1875 10.546875 \n",
       "z\n",
       "\" id=\"SimHei-44\"/>\n",
       "       <path id=\"SimHei-32\"/>\n",
       "       <path d=\"M 2.734375 16.796875 \n",
       "Q 2.734375 26.171875 5.078125 30.65625 \n",
       "Q 7.421875 35.15625 12.890625 37.890625 \n",
       "Q 8.203125 40.625 6.640625 43.9375 \n",
       "Q 5.078125 47.265625 4.875 51.5625 \n",
       "Q 4.6875 55.859375 6.046875 58.984375 \n",
       "Q 7.421875 62.109375 10.15625 64.84375 \n",
       "Q 12.890625 67.578125 16.203125 68.546875 \n",
       "Q 19.53125 69.53125 23.4375 69.53125 \n",
       "Q 27.34375 69.53125 30.46875 68.75 \n",
       "Q 33.59375 67.96875 37.109375 65.421875 \n",
       "Q 40.625 62.890625 42.1875 58.203125 \n",
       "Q 43.75 53.515625 41.984375 47.265625 \n",
       "Q 40.234375 41.015625 32.8125 37.5 \n",
       "Q 39.453125 35.546875 42.1875 31.4375 \n",
       "Q 44.921875 27.34375 44.921875 21.484375 \n",
       "Q 44.921875 15.625 43.15625 12.109375 \n",
       "Q 41.40625 8.59375 39.25 6.25 \n",
       "Q 37.109375 3.90625 33.390625 2.53125 \n",
       "Q 29.6875 1.171875 24.015625 1.171875 \n",
       "Q 18.359375 1.171875 14.25 2.53125 \n",
       "Q 10.15625 3.90625 7.421875 6.640625 \n",
       "Q 4.6875 9.375 3.703125 13.078125 \n",
       "Q 2.734375 16.796875 2.734375 26.171875 \n",
       "z\n",
       "M 10.9375 26.5625 \n",
       "Q 10.546875 17.1875 12.296875 13.671875 \n",
       "Q 14.0625 10.15625 18.75 9.171875 \n",
       "Q 23.4375 8.203125 28.515625 9.375 \n",
       "Q 33.59375 10.546875 35.546875 14.84375 \n",
       "Q 37.5 19.140625 36.90625 23.4375 \n",
       "Q 36.328125 27.734375 32.03125 30.65625 \n",
       "Q 27.734375 33.59375 22.65625 33.203125 \n",
       "Q 17.578125 32.8125 14.25 29.6875 \n",
       "Q 10.9375 26.5625 10.546875 17.1875 \n",
       "z\n",
       "M 12.109375 56.25 \n",
       "Q 12.109375 48.4375 14.84375 44.921875 \n",
       "Q 17.578125 41.40625 23.4375 41.40625 \n",
       "Q 29.296875 41.40625 32.21875 44.921875 \n",
       "Q 35.15625 48.4375 34.953125 53.3125 \n",
       "Q 34.765625 58.203125 31.4375 60.546875 \n",
       "Q 28.125 62.890625 22.453125 62.5 \n",
       "Q 16.796875 62.109375 14.453125 59.171875 \n",
       "Q 12.109375 56.25 12.109375 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-56\"/>\n",
       "       <path d=\"M 3.515625 19.53125 \n",
       "Q 4.296875 30.859375 6.046875 34.765625 \n",
       "Q 7.8125 38.671875 11.328125 44.53125 \n",
       "L 27.34375 69.53125 \n",
       "L 36.328125 69.53125 \n",
       "L 19.921875 43.75 \n",
       "Q 30.46875 46.484375 36.71875 42.96875 \n",
       "Q 42.96875 39.453125 45.109375 34.953125 \n",
       "Q 47.265625 30.46875 47.453125 25.1875 \n",
       "Q 47.65625 19.921875 45.890625 14.84375 \n",
       "Q 44.140625 9.765625 39.640625 5.65625 \n",
       "Q 35.15625 1.5625 27.140625 1.171875 \n",
       "Q 19.140625 0.78125 13.46875 4.09375 \n",
       "Q 7.8125 7.421875 5.65625 13.46875 \n",
       "Q 3.515625 19.53125 4.296875 30.859375 \n",
       "z\n",
       "M 12.5 16.015625 \n",
       "Q 19.53125 8.59375 25.390625 8.203125 \n",
       "Q 31.25 7.8125 35.15625 12.109375 \n",
       "Q 39.0625 16.40625 39.0625 24.609375 \n",
       "Q 39.0625 32.8125 34.171875 35.9375 \n",
       "Q 29.296875 39.0625 23.234375 38.28125 \n",
       "Q 17.1875 37.5 14.453125 32.421875 \n",
       "Q 11.71875 27.34375 12.109375 21.671875 \n",
       "Q 12.5 16.015625 19.53125 8.59375 \n",
       "z\n",
       "\" id=\"SimHei-54\"/>\n",
       "       <path d=\"M 13.28125 2.34375 \n",
       "Q 20.3125 32.03125 37.890625 61.328125 \n",
       "L 4.296875 61.328125 \n",
       "L 4.296875 68.359375 \n",
       "L 46.09375 68.359375 \n",
       "L 46.09375 61.71875 \n",
       "Q 27.734375 32.03125 21.875 2.34375 \n",
       "L 13.28125 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-55\"/>\n",
       "       <path d=\"M 29.296875 -8.203125 \n",
       "L 4.6875 -8.203125 \n",
       "L 4.6875 -1.953125 \n",
       "L 22.65625 -1.953125 \n",
       "L 22.65625 72.65625 \n",
       "L 4.6875 72.65625 \n",
       "L 4.6875 78.90625 \n",
       "L 29.296875 78.90625 \n",
       "z\n",
       "\" id=\"SimHei-93\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(65.225 311.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-45\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-57\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-56\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"700\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"750\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"117.9\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- (18.167, 36.333] -->\n",
       "      <defs>\n",
       "       <path d=\"M 3.90625 19.140625 \n",
       "L 10.9375 20.3125 \n",
       "Q 12.5 15.234375 16.015625 11.90625 \n",
       "Q 19.53125 8.59375 24.796875 8.78125 \n",
       "Q 30.078125 8.984375 33.203125 13.078125 \n",
       "Q 36.328125 17.1875 35.9375 22.453125 \n",
       "Q 35.546875 27.734375 31.828125 30.65625 \n",
       "Q 28.125 33.59375 19.921875 34.765625 \n",
       "L 19.921875 39.84375 \n",
       "Q 28.125 40.625 31.828125 44.140625 \n",
       "Q 35.546875 47.65625 35.15625 53.3125 \n",
       "Q 34.765625 58.984375 30.078125 61.515625 \n",
       "Q 25.390625 64.0625 20.109375 62.109375 \n",
       "Q 14.84375 60.15625 11.71875 51.171875 \n",
       "L 4.6875 52.34375 \n",
       "Q 7.03125 59.375 11.125 64.0625 \n",
       "Q 15.234375 68.75 22.265625 69.53125 \n",
       "Q 29.296875 70.3125 34.5625 67.765625 \n",
       "Q 39.84375 65.234375 41.984375 59.953125 \n",
       "Q 44.140625 54.6875 42.578125 48.4375 \n",
       "Q 41.015625 42.1875 33.59375 37.5 \n",
       "Q 39.0625 35.15625 41.984375 30.46875 \n",
       "Q 44.921875 25.78125 43.9375 18.15625 \n",
       "Q 42.96875 10.546875 37.109375 5.859375 \n",
       "Q 31.25 1.171875 23.828125 1.359375 \n",
       "Q 16.40625 1.5625 10.9375 6.046875 \n",
       "Q 5.46875 10.546875 3.90625 19.140625 \n",
       "z\n",
       "\" id=\"SimHei-51\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(121.025 311.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-56\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"700\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"750\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"173.7\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- (36.333, 54.5] -->\n",
       "      <defs>\n",
       "       <path d=\"M 8.59375 20.703125 \n",
       "Q 11.328125 10.15625 17.96875 8.984375 \n",
       "Q 24.609375 7.8125 28.703125 10.34375 \n",
       "Q 32.8125 12.890625 34.5625 16.984375 \n",
       "Q 36.328125 21.09375 36.125 26.171875 \n",
       "Q 35.9375 31.25 33.390625 34.765625 \n",
       "Q 30.859375 38.28125 26.953125 39.453125 \n",
       "Q 23.046875 40.625 18.15625 39.453125 \n",
       "Q 13.28125 38.28125 10.15625 33.984375 \n",
       "L 3.515625 34.765625 \n",
       "Q 4.296875 37.109375 10.9375 68.359375 \n",
       "L 41.796875 68.359375 \n",
       "L 41.796875 61.328125 \n",
       "L 16.796875 61.328125 \n",
       "Q 14.84375 50.78125 12.890625 44.53125 \n",
       "Q 18.75 47.265625 23.828125 47.0625 \n",
       "Q 28.90625 46.875 33.59375 44.71875 \n",
       "Q 38.28125 42.578125 40.421875 38.859375 \n",
       "Q 42.578125 35.15625 43.546875 31.4375 \n",
       "Q 44.53125 27.734375 44.328125 23.4375 \n",
       "Q 44.140625 19.140625 42.578125 14.640625 \n",
       "Q 41.015625 10.15625 37.890625 7.21875 \n",
       "Q 34.765625 4.296875 30.265625 2.53125 \n",
       "Q 25.78125 0.78125 19.921875 1.171875 \n",
       "Q 14.0625 1.5625 8.78125 5.46875 \n",
       "Q 3.515625 9.375 1.5625 18.75 \n",
       "z\n",
       "\" id=\"SimHei-53\"/>\n",
       "       <path d=\"M 31.25 17.1875 \n",
       "L 1.171875 17.1875 \n",
       "L 1.171875 23.828125 \n",
       "L 32.8125 69.53125 \n",
       "L 38.671875 69.53125 \n",
       "L 38.671875 23.828125 \n",
       "L 48.046875 23.828125 \n",
       "L 48.046875 17.1875 \n",
       "L 38.671875 17.1875 \n",
       "L 38.671875 2.34375 \n",
       "L 31.25 2.34375 \n",
       "z\n",
       "M 31.25 23.828125 \n",
       "L 31.25 54.6875 \n",
       "L 9.375 23.828125 \n",
       "z\n",
       "\" id=\"SimHei-52\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(176.825 301.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-52\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"229.5\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- (54.5, 72.667] -->\n",
       "      <defs>\n",
       "       <path d=\"M 4.6875 3.90625 \n",
       "Q 5.078125 9.765625 10.15625 14.453125 \n",
       "Q 15.234375 19.140625 23.046875 29.09375 \n",
       "Q 30.859375 39.0625 33.203125 44.53125 \n",
       "Q 35.546875 50 34.953125 53.90625 \n",
       "Q 34.375 57.8125 31.25 60.34375 \n",
       "Q 28.125 62.890625 24.015625 62.5 \n",
       "Q 19.921875 62.109375 16.203125 59.375 \n",
       "Q 12.5 56.640625 10.546875 51.171875 \n",
       "L 3.125 52.34375 \n",
       "Q 6.25 61.328125 11.125 65.421875 \n",
       "Q 16.015625 69.53125 22.65625 69.921875 \n",
       "Q 26.5625 70.3125 29.6875 69.71875 \n",
       "Q 32.8125 69.140625 36.125 66.984375 \n",
       "Q 39.453125 64.84375 41.59375 60.546875 \n",
       "Q 43.75 56.25 43.15625 50.1875 \n",
       "Q 42.578125 44.140625 37.109375 35.734375 \n",
       "Q 31.640625 27.34375 16.015625 9.375 \n",
       "L 44.140625 9.375 \n",
       "L 44.140625 2.34375 \n",
       "L 4.6875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-50\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(232.625 301.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-52\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"285.3\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- (72.667, 90.833] -->\n",
       "      <g transform=\"translate(288.425 311.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-54\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-57\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-56\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"700\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"750\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"341.1\" xlink:href=\"#m5e79d39cd8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- (90.833, 109.0] -->\n",
       "      <g transform=\"translate(344.225 306.64)rotate(-90)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-40\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-57\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"200\" xlink:href=\"#SimHei-56\"/>\n",
       "       <use x=\"250\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"300\" xlink:href=\"#SimHei-51\"/>\n",
       "       <use x=\"350\" xlink:href=\"#SimHei-44\"/>\n",
       "       <use x=\"400\" xlink:href=\"#SimHei-32\"/>\n",
       "       <use x=\"450\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"500\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"550\" xlink:href=\"#SimHei-57\"/>\n",
       "       <use x=\"600\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"650\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"700\" xlink:href=\"#SimHei-93\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <!-- 年龄 -->\n",
       "     <defs>\n",
       "      <path d=\"M 5.46875 45.703125 \n",
       "Q 14.0625 53.90625 21.484375 65.625 \n",
       "Q 28.90625 77.34375 29.6875 82.421875 \n",
       "Q 35.546875 80.078125 40.625 78.90625 \n",
       "Q 37.109375 75.390625 32.8125 67.578125 \n",
       "L 72.265625 67.578125 \n",
       "Q 80.859375 67.578125 89.84375 67.96875 \n",
       "L 89.84375 61.328125 \n",
       "Q 81.640625 61.71875 72.265625 61.71875 \n",
       "L 59.375 61.71875 \n",
       "L 59.375 45.703125 \n",
       "Q 74.21875 45.703125 85.546875 46.09375 \n",
       "L 85.546875 39.453125 \n",
       "Q 73.828125 39.84375 59.375 39.84375 \n",
       "L 59.375 21.484375 \n",
       "L 79.296875 21.484375 \n",
       "Q 87.890625 21.484375 95.3125 21.875 \n",
       "L 95.3125 15.234375 \n",
       "Q 88.28125 15.625 79.296875 15.625 \n",
       "L 59.375 15.625 \n",
       "L 59.375 6.640625 \n",
       "Q 59.375 -2.34375 59.765625 -9.765625 \n",
       "L 51.171875 -9.765625 \n",
       "Q 51.5625 -2.34375 51.5625 5.859375 \n",
       "L 51.5625 15.625 \n",
       "L 25 15.625 \n",
       "Q 14.0625 15.625 4.296875 15.234375 \n",
       "L 4.296875 21.875 \n",
       "Q 13.671875 21.484375 22.65625 21.484375 \n",
       "Q 22.65625 36.71875 22.265625 45.703125 \n",
       "L 51.5625 45.703125 \n",
       "L 51.5625 61.71875 \n",
       "L 29.296875 61.71875 \n",
       "Q 21.09375 49.21875 14.453125 41.40625 \n",
       "Q 10.15625 44.921875 5.46875 45.703125 \n",
       "z\n",
       "M 51.5625 21.484375 \n",
       "L 51.5625 39.84375 \n",
       "L 30.078125 39.84375 \n",
       "L 30.078125 21.484375 \n",
       "z\n",
       "\" id=\"SimHei-24180\"/>\n",
       "      <path d=\"M 33.203125 40.234375 \n",
       "Q 32.421875 39.0625 31.4375 36.71875 \n",
       "Q 30.46875 34.375 29.6875 30.859375 \n",
       "Q 35.9375 21.09375 38.671875 15.625 \n",
       "Q 35.9375 14.0625 33.203125 10.9375 \n",
       "Q 32.421875 14.0625 27.34375 24.21875 \n",
       "Q 25.78125 18.359375 21.09375 8.203125 \n",
       "Q 18.75 10.15625 14.84375 11.71875 \n",
       "L 14.84375 2.734375 \n",
       "Q 29.296875 4.296875 39.453125 5.46875 \n",
       "Q 39.453125 32.03125 39.0625 38.28125 \n",
       "L 46.484375 38.28125 \n",
       "Q 45.703125 32.8125 45.703125 15.625 \n",
       "Q 45.703125 -1.171875 46.09375 -8.59375 \n",
       "L 39.453125 -8.59375 \n",
       "L 39.453125 -0.390625 \n",
       "Q 33.984375 -0.390625 8.203125 -3.90625 \n",
       "Q 8.59375 3.90625 8.59375 18.75 \n",
       "Q 8.59375 33.59375 8.203125 39.0625 \n",
       "L 15.625 39.0625 \n",
       "Q 14.84375 33.59375 14.84375 12.109375 \n",
       "Q 19.53125 18.359375 22.265625 27.53125 \n",
       "Q 25 36.71875 25.390625 42.96875 \n",
       "Q 28.125 41.796875 33.203125 40.234375 \n",
       "z\n",
       "M 17.96875 71.484375 \n",
       "Q 17.578125 66.40625 17.578125 51.171875 \n",
       "L 26.953125 51.171875 \n",
       "Q 26.953125 73.828125 26.5625 79.6875 \n",
       "L 33.984375 79.6875 \n",
       "Q 33.203125 75.390625 33.203125 67.96875 \n",
       "Q 39.0625 67.96875 46.09375 68.359375 \n",
       "L 46.09375 62.109375 \n",
       "Q 39.84375 62.5 33.203125 62.5 \n",
       "L 33.203125 51.171875 \n",
       "Q 40.625 51.171875 46.09375 51.5625 \n",
       "L 46.09375 45.3125 \n",
       "Q 40.234375 45.703125 24.609375 45.703125 \n",
       "Q 8.984375 45.703125 4.296875 45.3125 \n",
       "L 4.296875 51.953125 \n",
       "Q 7.8125 51.5625 11.328125 51.5625 \n",
       "Q 11.328125 66.015625 10.9375 71.484375 \n",
       "L 17.96875 71.484375 \n",
       "z\n",
       "M 89.84375 32.421875 \n",
       "Q 79.6875 14.84375 73.4375 4.296875 \n",
       "Q 76.5625 1.171875 82.03125 -5.078125 \n",
       "Q 78.125 -7.8125 76.171875 -9.765625 \n",
       "Q 70.703125 -3.515625 65.234375 2.53125 \n",
       "Q 59.765625 8.59375 53.90625 13.671875 \n",
       "Q 56.640625 16.015625 58.59375 17.96875 \n",
       "Q 60.9375 16.015625 68.359375 9.375 \n",
       "Q 74.21875 17.96875 78.515625 26.953125 \n",
       "L 58.984375 26.953125 \n",
       "Q 56.25 26.953125 51.5625 26.5625 \n",
       "L 51.5625 32.8125 \n",
       "Q 56.25 32.421875 62.890625 32.421875 \n",
       "z\n",
       "M 73.4375 78.125 \n",
       "Q 72.65625 76.5625 71.09375 73.828125 \n",
       "Q 75.390625 65.625 81.640625 58.59375 \n",
       "Q 87.890625 51.5625 96.875 47.265625 \n",
       "Q 93.359375 46.09375 90.625 41.015625 \n",
       "Q 82.421875 47.65625 77.734375 53.3125 \n",
       "Q 73.046875 58.984375 68.359375 67.96875 \n",
       "Q 66.015625 61.328125 62.109375 53.703125 \n",
       "Q 58.203125 46.09375 51.171875 37.890625 \n",
       "Q 48.046875 41.015625 45.3125 42.1875 \n",
       "Q 51.5625 48.4375 57.21875 58.984375 \n",
       "Q 62.890625 69.53125 64.453125 81.25 \n",
       "Q 68.75 79.296875 73.4375 78.125 \n",
       "z\n",
       "M 69.140625 50.78125 \n",
       "Q 71.09375 47.265625 76.171875 39.0625 \n",
       "Q 73.046875 37.5 69.921875 35.15625 \n",
       "Q 66.796875 41.40625 63.28125 46.875 \n",
       "Q 66.40625 49.21875 69.140625 50.78125 \n",
       "z\n",
       "\" id=\"SimHei-40836\"/>\n",
       "     </defs>\n",
       "     <g transform=\"translate(191.6 323.60875)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#SimHei-24180\"/>\n",
       "      <use x=\"100\" xlink:href=\"#SimHei-40836\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m504569cb12\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 0.00 -->\n",
       "      <g transform=\"translate(7.2 228.0775)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"187.030461\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0.02 -->\n",
       "      <g transform=\"translate(7.2 190.467961)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-50\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"149.420921\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 0.04 -->\n",
       "      <g transform=\"translate(7.2 152.858421)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-52\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"111.811382\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0.06 -->\n",
       "      <g transform=\"translate(7.2 115.248882)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-54\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"74.201842\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 0.08 -->\n",
       "      <g transform=\"translate(7.2 77.639342)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-56\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m504569cb12\" y=\"36.592303\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0.10 -->\n",
       "      <g transform=\"translate(7.2 40.029803)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 34.2 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 369 224.64 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_11\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path d=\"M 34.2 7.2 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p6bfce38553\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"34.2\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "age_cut = pd.cut(data['年龄'], 6)\n",
    "all_age_user = data['好坏客户'].groupby(age_cut).count()\n",
    "bad_age_user = data['好坏客户'].groupby(age_cut).sum()\n",
    "bad_rate = bad_age_user / all_age_user\n",
    "bad_rate\n",
    "bad_rate.plot.bar()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4.3 家庭人口数量和坏账率有什么关系？\n",
    "是家庭人口越多，负担越重，坏账率越高？还是家庭人口越多，劳动力越多，坏账率越低呢？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "家属数量\n",
       "0.0     0.058629\n",
       "1.0     0.073529\n",
       "2.0     0.081139\n",
       "3.0     0.088263\n",
       "4.0     0.103774\n",
       "5.0     0.091153\n",
       "6.0     0.151899\n",
       "7.0     0.098039\n",
       "8.0     0.083333\n",
       "9.0     0.000000\n",
       "10.0    0.000000\n",
       "13.0    0.000000\n",
       "20.0    0.000000\n",
       "Name: 好坏客户, dtype: float64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x11f7a9210>"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"260.261875pt\" version=\"1.1\" viewBox=\"0 0 386.2 260.261875\" width=\"386.2pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 260.261875 \n",
       "L 386.2 260.261875 \n",
       "L 386.2 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "L 369 7.2 \n",
       "L 34.2 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m710f66d83a\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0.0 -->\n",
       "      <defs>\n",
       "       <path d=\"M 3.125 29.296875 \n",
       "Q 3.90625 50 6.4375 56.046875 \n",
       "Q 8.984375 62.109375 13.671875 66.015625 \n",
       "Q 18.359375 69.921875 25.1875 69.921875 \n",
       "Q 32.03125 69.921875 37.109375 64.25 \n",
       "Q 42.1875 58.59375 43.75 50 \n",
       "Q 45.3125 41.40625 44.71875 30.265625 \n",
       "Q 44.140625 19.140625 40.8125 12.109375 \n",
       "Q 37.5 5.078125 30.859375 2.34375 \n",
       "Q 24.21875 -0.390625 17.578125 2.921875 \n",
       "Q 10.9375 6.25 8.203125 11.71875 \n",
       "Q 5.46875 17.1875 4.296875 23.234375 \n",
       "Q 3.125 29.296875 3.90625 50 \n",
       "z\n",
       "M 12.890625 52.734375 \n",
       "Q 10.546875 31.25 12.5 22.84375 \n",
       "Q 14.453125 14.453125 18.9375 10.9375 \n",
       "Q 23.4375 7.421875 28.125 9.5625 \n",
       "Q 32.8125 11.71875 34.953125 18.15625 \n",
       "Q 37.109375 24.609375 37.109375 32.21875 \n",
       "Q 37.109375 39.84375 36.515625 46.09375 \n",
       "Q 35.9375 52.34375 33 57.421875 \n",
       "Q 30.078125 62.5 25.1875 62.6875 \n",
       "Q 20.3125 62.890625 16.59375 57.8125 \n",
       "Q 12.890625 52.734375 10.546875 31.25 \n",
       "z\n",
       "\" id=\"SimHei-48\"/>\n",
       "       <path d=\"M 16.796875 1.953125 \n",
       "L 7.8125 1.953125 \n",
       "L 7.8125 10.546875 \n",
       "L 16.796875 10.546875 \n",
       "z\n",
       "\" id=\"SimHei-46\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(26.7 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"76.05\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2.5 -->\n",
       "      <defs>\n",
       "       <path d=\"M 4.6875 3.90625 \n",
       "Q 5.078125 9.765625 10.15625 14.453125 \n",
       "Q 15.234375 19.140625 23.046875 29.09375 \n",
       "Q 30.859375 39.0625 33.203125 44.53125 \n",
       "Q 35.546875 50 34.953125 53.90625 \n",
       "Q 34.375 57.8125 31.25 60.34375 \n",
       "Q 28.125 62.890625 24.015625 62.5 \n",
       "Q 19.921875 62.109375 16.203125 59.375 \n",
       "Q 12.5 56.640625 10.546875 51.171875 \n",
       "L 3.125 52.34375 \n",
       "Q 6.25 61.328125 11.125 65.421875 \n",
       "Q 16.015625 69.53125 22.65625 69.921875 \n",
       "Q 26.5625 70.3125 29.6875 69.71875 \n",
       "Q 32.8125 69.140625 36.125 66.984375 \n",
       "Q 39.453125 64.84375 41.59375 60.546875 \n",
       "Q 43.75 56.25 43.15625 50.1875 \n",
       "Q 42.578125 44.140625 37.109375 35.734375 \n",
       "Q 31.640625 27.34375 16.015625 9.375 \n",
       "L 44.140625 9.375 \n",
       "L 44.140625 2.34375 \n",
       "L 4.6875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-50\"/>\n",
       "       <path d=\"M 8.59375 20.703125 \n",
       "Q 11.328125 10.15625 17.96875 8.984375 \n",
       "Q 24.609375 7.8125 28.703125 10.34375 \n",
       "Q 32.8125 12.890625 34.5625 16.984375 \n",
       "Q 36.328125 21.09375 36.125 26.171875 \n",
       "Q 35.9375 31.25 33.390625 34.765625 \n",
       "Q 30.859375 38.28125 26.953125 39.453125 \n",
       "Q 23.046875 40.625 18.15625 39.453125 \n",
       "Q 13.28125 38.28125 10.15625 33.984375 \n",
       "L 3.515625 34.765625 \n",
       "Q 4.296875 37.109375 10.9375 68.359375 \n",
       "L 41.796875 68.359375 \n",
       "L 41.796875 61.328125 \n",
       "L 16.796875 61.328125 \n",
       "Q 14.84375 50.78125 12.890625 44.53125 \n",
       "Q 18.75 47.265625 23.828125 47.0625 \n",
       "Q 28.90625 46.875 33.59375 44.71875 \n",
       "Q 38.28125 42.578125 40.421875 38.859375 \n",
       "Q 42.578125 35.15625 43.546875 31.4375 \n",
       "Q 44.53125 27.734375 44.328125 23.4375 \n",
       "Q 44.140625 19.140625 42.578125 14.640625 \n",
       "Q 41.015625 10.15625 37.890625 7.21875 \n",
       "Q 34.765625 4.296875 30.265625 2.53125 \n",
       "Q 25.78125 0.78125 19.921875 1.171875 \n",
       "Q 14.0625 1.5625 8.78125 5.46875 \n",
       "Q 3.515625 9.375 1.5625 18.75 \n",
       "z\n",
       "\" id=\"SimHei-53\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(68.55 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-53\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"117.9\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 5.0 -->\n",
       "      <g transform=\"translate(110.4 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.75\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 7.5 -->\n",
       "      <defs>\n",
       "       <path d=\"M 13.28125 2.34375 \n",
       "Q 20.3125 32.03125 37.890625 61.328125 \n",
       "L 4.296875 61.328125 \n",
       "L 4.296875 68.359375 \n",
       "L 46.09375 68.359375 \n",
       "L 46.09375 61.71875 \n",
       "Q 27.734375 32.03125 21.875 2.34375 \n",
       "L 13.28125 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-55\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(152.25 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-53\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"201.6\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 10.0 -->\n",
       "      <defs>\n",
       "       <path d=\"M 21.875 56.25 \n",
       "Q 16.796875 51.171875 8.984375 46.484375 \n",
       "L 8.984375 53.90625 \n",
       "Q 18.75 60.546875 25 69.53125 \n",
       "L 29.6875 69.53125 \n",
       "L 29.6875 2.34375 \n",
       "L 21.875 2.34375 \n",
       "z\n",
       "\" id=\"SimHei-49\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(191.6 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"243.45\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 12.5 -->\n",
       "      <g transform=\"translate(233.45 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-53\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"285.3\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 15.0 -->\n",
       "      <g transform=\"translate(275.3 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-53\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"327.15\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 17.5 -->\n",
       "      <g transform=\"translate(317.15 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-55\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-53\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"369\" xlink:href=\"#m710f66d83a\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 20.0 -->\n",
       "      <g transform=\"translate(359 238.515)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-50\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_10\">\n",
       "     <!-- 家属数量 -->\n",
       "     <defs>\n",
       "      <path d=\"M 53.515625 17.578125 \n",
       "Q 40.625 7.421875 29.6875 1.5625 \n",
       "Q 18.75 -4.296875 10.9375 -8.203125 \n",
       "Q 7.8125 -4.296875 5.078125 -1.171875 \n",
       "Q 24.21875 5.078125 35.34375 12.109375 \n",
       "Q 46.484375 19.140625 51.171875 24.21875 \n",
       "Q 49.609375 26.953125 48.046875 28.90625 \n",
       "Q 35.9375 20.3125 26.5625 15.234375 \n",
       "Q 17.1875 10.15625 11.71875 8.203125 \n",
       "Q 8.984375 12.109375 5.859375 14.84375 \n",
       "Q 21.484375 19.53125 30.65625 25 \n",
       "Q 39.84375 30.46875 43.75 33.984375 \n",
       "Q 42.1875 35.9375 40.234375 38.28125 \n",
       "Q 33.984375 34.765625 26.75 31.4375 \n",
       "Q 19.53125 28.125 11.328125 24.609375 \n",
       "Q 8.984375 28.515625 5.859375 32.421875 \n",
       "Q 21.875 36.328125 30.46875 40.625 \n",
       "Q 39.0625 44.921875 42.96875 49.21875 \n",
       "L 37.5 49.21875 \n",
       "Q 32.03125 49.21875 24.609375 48.828125 \n",
       "L 24.609375 55.859375 \n",
       "Q 32.03125 55.46875 37.5 55.46875 \n",
       "L 64.0625 55.46875 \n",
       "Q 69.140625 55.46875 76.5625 55.859375 \n",
       "L 76.5625 48.828125 \n",
       "Q 69.140625 49.21875 64.0625 49.21875 \n",
       "L 53.515625 49.21875 \n",
       "Q 50 46.09375 45.703125 42.1875 \n",
       "Q 48.828125 39.453125 51.5625 36.515625 \n",
       "Q 54.296875 33.59375 57.421875 28.515625 \n",
       "Q 62.109375 30.859375 67.96875 34.953125 \n",
       "Q 73.828125 39.0625 78.515625 45.3125 \n",
       "Q 84.375 39.84375 86.328125 37.890625 \n",
       "Q 81.640625 35.9375 78.125 33.984375 \n",
       "Q 74.609375 32.03125 72.265625 29.6875 \n",
       "Q 75.78125 17.96875 81.25 12.890625 \n",
       "Q 86.71875 7.8125 96.484375 3.125 \n",
       "Q 92.578125 0.390625 89.453125 -4.296875 \n",
       "Q 78.515625 2.734375 73.4375 10.34375 \n",
       "Q 68.359375 17.96875 66.40625 26.171875 \n",
       "Q 63.28125 24.21875 60.15625 22.65625 \n",
       "Q 62.109375 12.109375 61.90625 5.078125 \n",
       "Q 61.71875 -1.953125 56.046875 -5.65625 \n",
       "Q 50.390625 -9.375 42.578125 -10.546875 \n",
       "Q 41.015625 -5.46875 39.0625 -1.5625 \n",
       "Q 45.703125 -1.5625 49.609375 -0.390625 \n",
       "Q 53.515625 0.78125 54.09375 5.46875 \n",
       "Q 54.6875 10.15625 53.515625 17.578125 \n",
       "z\n",
       "M 52.34375 82.421875 \n",
       "Q 53.125 78.515625 55.859375 70.703125 \n",
       "L 91.796875 70.703125 \n",
       "Q 91.40625 64.453125 91.40625 60.546875 \n",
       "Q 91.40625 57.03125 91.796875 51.5625 \n",
       "L 83.59375 51.5625 \n",
       "L 83.59375 64.453125 \n",
       "L 15.625 64.453125 \n",
       "L 15.625 49.609375 \n",
       "L 7.421875 49.609375 \n",
       "Q 7.8125 55.859375 7.8125 60.546875 \n",
       "Q 7.8125 65.625 7.421875 70.703125 \n",
       "L 46.484375 70.703125 \n",
       "Q 44.921875 75.78125 42.96875 79.6875 \n",
       "Q 48.046875 80.859375 52.34375 82.421875 \n",
       "z\n",
       "\" id=\"SimHei-23478\"/>\n",
       "      <path d=\"M 86.71875 48.4375 \n",
       "Q 69.53125 47.65625 59.765625 47.265625 \n",
       "L 59.765625 41.796875 \n",
       "L 83.984375 41.796875 \n",
       "Q 83.59375 37.5 83.59375 33.203125 \n",
       "Q 83.59375 28.90625 83.984375 24.609375 \n",
       "L 59.765625 24.609375 \n",
       "L 59.765625 19.53125 \n",
       "L 91.796875 19.53125 \n",
       "Q 91.40625 13.28125 91.40625 8.203125 \n",
       "L 91.40625 -2.34375 \n",
       "Q 91.015625 -5.859375 88.859375 -7.21875 \n",
       "Q 86.71875 -8.59375 78.125 -10.15625 \n",
       "Q 77.34375 -6.25 74.609375 -2.34375 \n",
       "Q 79.6875 -2.34375 82.21875 -2.140625 \n",
       "Q 84.765625 -1.953125 84.375 1.953125 \n",
       "L 84.375 14.0625 \n",
       "L 59.765625 14.0625 \n",
       "L 59.765625 7.03125 \n",
       "Q 65.625 7.421875 69.140625 7.8125 \n",
       "Q 67.96875 9.765625 67.1875 10.9375 \n",
       "Q 70.703125 12.109375 72.65625 13.671875 \n",
       "Q 76.953125 7.421875 80.078125 1.953125 \n",
       "Q 77.34375 0.78125 73.828125 -1.171875 \n",
       "Q 73.046875 0.390625 71.875 2.34375 \n",
       "Q 68.359375 2.34375 59.375 1.359375 \n",
       "Q 50.390625 0.390625 40.625 -1.171875 \n",
       "Q 40.234375 1.953125 38.28125 5.859375 \n",
       "Q 46.875 5.859375 53.125 6.640625 \n",
       "L 53.125 14.0625 \n",
       "L 34.375 14.0625 \n",
       "L 34.375 -8.59375 \n",
       "L 27.34375 -8.59375 \n",
       "Q 27.734375 -3.125 27.734375 5.078125 \n",
       "Q 27.734375 13.28125 27.34375 19.53125 \n",
       "L 53.125 19.53125 \n",
       "L 53.125 24.609375 \n",
       "L 31.25 24.609375 \n",
       "Q 31.640625 29.296875 31.640625 33.203125 \n",
       "Q 31.640625 37.5 31.25 41.796875 \n",
       "L 53.125 41.796875 \n",
       "L 53.125 46.875 \n",
       "Q 38.671875 46.09375 30.46875 45.703125 \n",
       "Q 29.6875 49.21875 27.734375 52.34375 \n",
       "Q 42.1875 52.34375 56.4375 53.125 \n",
       "Q 70.703125 53.90625 82.03125 55.859375 \n",
       "Q 83.984375 51.953125 86.71875 48.4375 \n",
       "z\n",
       "M 86.328125 78.125 \n",
       "Q 85.9375 71.875 85.9375 67.1875 \n",
       "Q 85.9375 62.890625 86.328125 58.59375 \n",
       "L 23.046875 58.59375 \n",
       "Q 23.046875 47.65625 22.84375 38.859375 \n",
       "Q 22.65625 30.078125 21.484375 22.453125 \n",
       "Q 20.3125 14.84375 18.15625 8 \n",
       "Q 16.015625 1.171875 11.71875 -7.03125 \n",
       "Q 8.203125 -5.078125 3.90625 -3.515625 \n",
       "Q 10.546875 7.03125 13.078125 17.1875 \n",
       "Q 15.625 27.34375 15.8125 38.859375 \n",
       "Q 16.015625 50.390625 16.015625 57.421875 \n",
       "Q 16.015625 64.453125 15.625 78.125 \n",
       "L 86.328125 78.125 \n",
       "z\n",
       "M 78.90625 64.0625 \n",
       "L 78.90625 71.875 \n",
       "L 23.046875 71.875 \n",
       "L 23.046875 64.0625 \n",
       "z\n",
       "M 77.34375 30.078125 \n",
       "L 77.34375 36.71875 \n",
       "L 59.765625 36.71875 \n",
       "L 59.765625 30.078125 \n",
       "z\n",
       "M 53.125 30.078125 \n",
       "L 53.125 36.71875 \n",
       "L 37.890625 36.71875 \n",
       "L 37.890625 30.078125 \n",
       "z\n",
       "\" id=\"SimHei-23646\"/>\n",
       "      <path d=\"M 70.703125 76.953125 \n",
       "Q 69.921875 75 68.75 71.671875 \n",
       "Q 67.578125 68.359375 65.234375 59.765625 \n",
       "L 83.203125 59.765625 \n",
       "Q 87.109375 59.765625 92.578125 60.15625 \n",
       "L 92.578125 53.125 \n",
       "Q 88.28125 53.515625 85.9375 53.515625 \n",
       "Q 85.9375 47.265625 83.78125 33.78125 \n",
       "Q 81.640625 20.3125 76.171875 10.546875 \n",
       "Q 80.078125 5.859375 84.953125 2.140625 \n",
       "Q 89.84375 -1.5625 94.140625 -3.125 \n",
       "Q 89.453125 -6.640625 87.890625 -9.765625 \n",
       "Q 83.203125 -7.03125 79.296875 -3.515625 \n",
       "Q 75.390625 0 71.484375 5.078125 \n",
       "Q 67.1875 0.390625 62.296875 -2.921875 \n",
       "Q 57.421875 -6.25 50 -10.15625 \n",
       "Q 48.046875 -6.640625 44.53125 -4.6875 \n",
       "Q 50.390625 -2.34375 57.03125 1.953125 \n",
       "Q 63.671875 6.25 67.1875 10.546875 \n",
       "Q 64.453125 16.015625 61.90625 22.265625 \n",
       "Q 59.375 28.515625 57.421875 38.671875 \n",
       "Q 56.25 35.546875 53.515625 30.46875 \n",
       "Q 50.78125 32.03125 46.875 33.59375 \n",
       "Q 53.125 44.53125 57.03125 57.421875 \n",
       "Q 60.9375 70.3125 62.109375 79.6875 \n",
       "Q 66.796875 77.734375 70.703125 76.953125 \n",
       "z\n",
       "M 32.8125 35.15625 \n",
       "Q 31.25 33.59375 29.296875 30.078125 \n",
       "L 50.78125 30.078125 \n",
       "Q 48.4375 20.3125 42.578125 10.546875 \n",
       "Q 48.828125 8.203125 52.34375 6.25 \n",
       "Q 50.390625 3.515625 48.828125 0.390625 \n",
       "Q 45.3125 2.734375 38.28125 5.078125 \n",
       "Q 30.46875 -3.515625 11.328125 -10.15625 \n",
       "Q 9.375 -5.859375 6.25 -4.296875 \n",
       "Q 24.609375 0 31.25 7.421875 \n",
       "Q 20.3125 10.15625 13.28125 12.109375 \n",
       "Q 15.625 15.625 19.53125 23.828125 \n",
       "Q 15.625 23.828125 6.640625 23.4375 \n",
       "L 6.640625 30.46875 \n",
       "Q 14.0625 30.078125 21.875 30.078125 \n",
       "Q 23.4375 33.59375 24.21875 37.890625 \n",
       "Q 28.515625 36.328125 32.8125 35.15625 \n",
       "z\n",
       "M 27.734375 61.71875 \n",
       "Q 27.734375 71.09375 27.34375 79.6875 \n",
       "L 35.15625 79.6875 \n",
       "Q 34.765625 71.484375 34.765625 61.71875 \n",
       "Q 48.046875 61.71875 53.515625 62.109375 \n",
       "L 53.515625 55.078125 \n",
       "Q 48.046875 55.46875 34.765625 55.46875 \n",
       "Q 34.765625 44.140625 35.15625 37.890625 \n",
       "L 27.34375 37.890625 \n",
       "Q 27.734375 43.359375 27.734375 51.5625 \n",
       "Q 25.78125 48.4375 20.3125 43.546875 \n",
       "Q 14.84375 38.671875 10.15625 35.9375 \n",
       "Q 8.203125 39.453125 4.296875 41.015625 \n",
       "Q 7.8125 42.1875 13.671875 46.484375 \n",
       "Q 19.53125 50.78125 22.65625 55.46875 \n",
       "Q 14.84375 55.46875 7.8125 55.078125 \n",
       "L 7.8125 62.109375 \n",
       "Q 14.453125 61.71875 27.734375 61.71875 \n",
       "z\n",
       "M 62.109375 49.609375 \n",
       "Q 65.625 26.5625 71.875 17.578125 \n",
       "Q 75.78125 26.5625 77.140625 35.734375 \n",
       "Q 78.515625 44.921875 78.90625 53.515625 \n",
       "L 63.671875 53.515625 \n",
       "L 62.109375 49.609375 \n",
       "z\n",
       "M 22.65625 15.625 \n",
       "Q 27.34375 14.453125 35.546875 12.5 \n",
       "Q 38.671875 16.40625 41.40625 23.828125 \n",
       "L 26.953125 23.828125 \n",
       "Q 25 19.921875 22.65625 15.625 \n",
       "z\n",
       "M 51.953125 75.390625 \n",
       "Q 50 72.265625 48.828125 69.53125 \n",
       "Q 47.65625 66.796875 45.703125 62.890625 \n",
       "Q 42.578125 64.453125 39.453125 65.234375 \n",
       "Q 42.578125 70.3125 45.3125 78.125 \n",
       "Q 49.21875 76.171875 51.953125 75.390625 \n",
       "z\n",
       "M 40.234375 52.734375 \n",
       "Q 45.3125 47.65625 50 42.578125 \n",
       "Q 47.65625 40.625 44.921875 37.890625 \n",
       "Q 39.453125 44.53125 35.9375 48.4375 \n",
       "Q 38.28125 50.390625 40.234375 52.734375 \n",
       "z\n",
       "M 14.453125 78.125 \n",
       "Q 19.921875 72.65625 23.4375 67.1875 \n",
       "L 17.578125 63.671875 \n",
       "Q 14.84375 69.140625 9.375 73.828125 \n",
       "Q 12.890625 76.171875 14.453125 78.125 \n",
       "z\n",
       "\" id=\"SimHei-25968\"/>\n",
       "      <path d=\"M 82.03125 39.0625 \n",
       "Q 81.640625 34.375 81.640625 26.5625 \n",
       "Q 81.640625 19.140625 82.03125 14.84375 \n",
       "L 53.515625 14.84375 \n",
       "L 53.515625 9.765625 \n",
       "L 71.484375 9.765625 \n",
       "Q 78.125 9.765625 83.984375 10.15625 \n",
       "L 83.984375 4.296875 \n",
       "Q 78.515625 4.6875 71.484375 4.6875 \n",
       "L 53.515625 4.6875 \n",
       "L 53.515625 -1.171875 \n",
       "L 80.078125 -1.171875 \n",
       "Q 86.328125 -1.171875 92.578125 -0.78125 \n",
       "L 92.578125 -6.640625 \n",
       "Q 86.328125 -6.25 80.078125 -6.25 \n",
       "L 19.921875 -6.25 \n",
       "Q 14.0625 -6.25 7.421875 -6.640625 \n",
       "L 7.421875 -0.78125 \n",
       "Q 14.453125 -0.78125 19.921875 -1.171875 \n",
       "L 46.484375 -1.171875 \n",
       "L 46.484375 4.6875 \n",
       "L 26.953125 4.6875 \n",
       "Q 21.09375 4.6875 15.234375 3.90625 \n",
       "L 15.234375 10.15625 \n",
       "Q 21.484375 9.765625 26.953125 9.765625 \n",
       "L 46.484375 9.765625 \n",
       "L 46.484375 14.84375 \n",
       "L 17.96875 14.84375 \n",
       "Q 18.359375 21.484375 18.359375 27.734375 \n",
       "Q 18.359375 33.984375 17.96875 39.0625 \n",
       "L 82.03125 39.0625 \n",
       "z\n",
       "M 81.25 77.34375 \n",
       "Q 80.859375 71.484375 80.859375 66.40625 \n",
       "Q 80.859375 61.328125 81.25 53.125 \n",
       "L 18.75 53.125 \n",
       "Q 19.140625 61.328125 19.140625 66.40625 \n",
       "Q 19.140625 71.484375 18.75 77.34375 \n",
       "L 81.25 77.34375 \n",
       "z\n",
       "M 76.5625 48.4375 \n",
       "Q 85.9375 48.828125 93.75 49.21875 \n",
       "L 93.75 42.96875 \n",
       "Q 85.9375 43.359375 76.953125 43.359375 \n",
       "L 25.78125 43.359375 \n",
       "Q 15.234375 43.359375 5.078125 42.96875 \n",
       "L 5.078125 49.21875 \n",
       "Q 15.234375 48.828125 25.78125 48.4375 \n",
       "z\n",
       "M 73.828125 57.8125 \n",
       "L 73.828125 62.890625 \n",
       "L 26.171875 62.890625 \n",
       "L 26.171875 57.8125 \n",
       "z\n",
       "M 73.828125 67.96875 \n",
       "L 73.828125 72.65625 \n",
       "L 26.171875 72.65625 \n",
       "L 26.171875 67.96875 \n",
       "z\n",
       "M 74.21875 29.296875 \n",
       "L 74.21875 33.984375 \n",
       "L 53.515625 33.984375 \n",
       "L 53.515625 29.296875 \n",
       "z\n",
       "M 46.484375 29.296875 \n",
       "L 46.484375 33.984375 \n",
       "L 25.78125 33.984375 \n",
       "L 25.78125 29.296875 \n",
       "z\n",
       "M 46.484375 19.921875 \n",
       "L 46.484375 24.21875 \n",
       "L 25.78125 24.21875 \n",
       "L 25.78125 19.921875 \n",
       "z\n",
       "M 74.21875 19.921875 \n",
       "L 74.21875 24.21875 \n",
       "L 53.515625 24.21875 \n",
       "L 53.515625 19.921875 \n",
       "z\n",
       "\" id=\"SimHei-37327\"/>\n",
       "     </defs>\n",
       "     <g transform=\"translate(181.6 251.811875)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#SimHei-23478\"/>\n",
       "      <use x=\"100\" xlink:href=\"#SimHei-23646\"/>\n",
       "      <use x=\"200\" xlink:href=\"#SimHei-25968\"/>\n",
       "      <use x=\"300\" xlink:href=\"#SimHei-37327\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m9fea9a6d7e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"214.756364\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0.00 -->\n",
       "      <g transform=\"translate(7.2 218.193864)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"188.729455\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 0.02 -->\n",
       "      <g transform=\"translate(7.2 192.166955)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-50\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"162.702545\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0.04 -->\n",
       "      <defs>\n",
       "       <path d=\"M 31.25 17.1875 \n",
       "L 1.171875 17.1875 \n",
       "L 1.171875 23.828125 \n",
       "L 32.8125 69.53125 \n",
       "L 38.671875 69.53125 \n",
       "L 38.671875 23.828125 \n",
       "L 48.046875 23.828125 \n",
       "L 48.046875 17.1875 \n",
       "L 38.671875 17.1875 \n",
       "L 38.671875 2.34375 \n",
       "L 31.25 2.34375 \n",
       "z\n",
       "M 31.25 23.828125 \n",
       "L 31.25 54.6875 \n",
       "L 9.375 23.828125 \n",
       "z\n",
       "\" id=\"SimHei-52\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 166.140045)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-52\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"136.675636\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 0.06 -->\n",
       "      <defs>\n",
       "       <path d=\"M 3.515625 19.53125 \n",
       "Q 4.296875 30.859375 6.046875 34.765625 \n",
       "Q 7.8125 38.671875 11.328125 44.53125 \n",
       "L 27.34375 69.53125 \n",
       "L 36.328125 69.53125 \n",
       "L 19.921875 43.75 \n",
       "Q 30.46875 46.484375 36.71875 42.96875 \n",
       "Q 42.96875 39.453125 45.109375 34.953125 \n",
       "Q 47.265625 30.46875 47.453125 25.1875 \n",
       "Q 47.65625 19.921875 45.890625 14.84375 \n",
       "Q 44.140625 9.765625 39.640625 5.65625 \n",
       "Q 35.15625 1.5625 27.140625 1.171875 \n",
       "Q 19.140625 0.78125 13.46875 4.09375 \n",
       "Q 7.8125 7.421875 5.65625 13.46875 \n",
       "Q 3.515625 19.53125 4.296875 30.859375 \n",
       "z\n",
       "M 12.5 16.015625 \n",
       "Q 19.53125 8.59375 25.390625 8.203125 \n",
       "Q 31.25 7.8125 35.15625 12.109375 \n",
       "Q 39.0625 16.40625 39.0625 24.609375 \n",
       "Q 39.0625 32.8125 34.171875 35.9375 \n",
       "Q 29.296875 39.0625 23.234375 38.28125 \n",
       "Q 17.1875 37.5 14.453125 32.421875 \n",
       "Q 11.71875 27.34375 12.109375 21.671875 \n",
       "Q 12.5 16.015625 19.53125 8.59375 \n",
       "z\n",
       "\" id=\"SimHei-54\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 140.113136)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-54\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"110.648727\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 0.08 -->\n",
       "      <defs>\n",
       "       <path d=\"M 2.734375 16.796875 \n",
       "Q 2.734375 26.171875 5.078125 30.65625 \n",
       "Q 7.421875 35.15625 12.890625 37.890625 \n",
       "Q 8.203125 40.625 6.640625 43.9375 \n",
       "Q 5.078125 47.265625 4.875 51.5625 \n",
       "Q 4.6875 55.859375 6.046875 58.984375 \n",
       "Q 7.421875 62.109375 10.15625 64.84375 \n",
       "Q 12.890625 67.578125 16.203125 68.546875 \n",
       "Q 19.53125 69.53125 23.4375 69.53125 \n",
       "Q 27.34375 69.53125 30.46875 68.75 \n",
       "Q 33.59375 67.96875 37.109375 65.421875 \n",
       "Q 40.625 62.890625 42.1875 58.203125 \n",
       "Q 43.75 53.515625 41.984375 47.265625 \n",
       "Q 40.234375 41.015625 32.8125 37.5 \n",
       "Q 39.453125 35.546875 42.1875 31.4375 \n",
       "Q 44.921875 27.34375 44.921875 21.484375 \n",
       "Q 44.921875 15.625 43.15625 12.109375 \n",
       "Q 41.40625 8.59375 39.25 6.25 \n",
       "Q 37.109375 3.90625 33.390625 2.53125 \n",
       "Q 29.6875 1.171875 24.015625 1.171875 \n",
       "Q 18.359375 1.171875 14.25 2.53125 \n",
       "Q 10.15625 3.90625 7.421875 6.640625 \n",
       "Q 4.6875 9.375 3.703125 13.078125 \n",
       "Q 2.734375 16.796875 2.734375 26.171875 \n",
       "z\n",
       "M 10.9375 26.5625 \n",
       "Q 10.546875 17.1875 12.296875 13.671875 \n",
       "Q 14.0625 10.15625 18.75 9.171875 \n",
       "Q 23.4375 8.203125 28.515625 9.375 \n",
       "Q 33.59375 10.546875 35.546875 14.84375 \n",
       "Q 37.5 19.140625 36.90625 23.4375 \n",
       "Q 36.328125 27.734375 32.03125 30.65625 \n",
       "Q 27.734375 33.59375 22.65625 33.203125 \n",
       "Q 17.578125 32.8125 14.25 29.6875 \n",
       "Q 10.9375 26.5625 10.546875 17.1875 \n",
       "z\n",
       "M 12.109375 56.25 \n",
       "Q 12.109375 48.4375 14.84375 44.921875 \n",
       "Q 17.578125 41.40625 23.4375 41.40625 \n",
       "Q 29.296875 41.40625 32.21875 44.921875 \n",
       "Q 35.15625 48.4375 34.953125 53.3125 \n",
       "Q 34.765625 58.203125 31.4375 60.546875 \n",
       "Q 28.125 62.890625 22.453125 62.5 \n",
       "Q 16.796875 62.109375 14.453125 59.171875 \n",
       "Q 12.109375 56.25 12.109375 48.4375 \n",
       "z\n",
       "\" id=\"SimHei-56\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(7.2 114.086227)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-56\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"84.621818\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 0.10 -->\n",
       "      <g transform=\"translate(7.2 88.059318)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"58.594909\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_17\">\n",
       "      <!-- 0.12 -->\n",
       "      <g transform=\"translate(7.2 62.032409)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-50\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.2\" xlink:href=\"#m9fea9a6d7e\" y=\"32.568\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_18\">\n",
       "      <!-- 0.14 -->\n",
       "      <g transform=\"translate(7.2 36.0055)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#SimHei-48\"/>\n",
       "       <use x=\"50\" xlink:href=\"#SimHei-46\"/>\n",
       "       <use x=\"100\" xlink:href=\"#SimHei-49\"/>\n",
       "       <use x=\"150\" xlink:href=\"#SimHei-52\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_18\">\n",
       "    <path clip-path=\"url(#p5359449fbc)\" d=\"M 34.2 138.459442 \n",
       "L 50.94 119.069198 \n",
       "L 67.68 109.166199 \n",
       "L 84.42 99.895439 \n",
       "L 101.16 79.711081 \n",
       "L 117.9 96.135062 \n",
       "L 134.64 17.083636 \n",
       "L 151.38 87.173476 \n",
       "L 168.12 106.310909 \n",
       "L 184.86 214.756364 \n",
       "L 201.6 214.756364 \n",
       "L 251.82 214.756364 \n",
       "L 369 214.756364 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 34.2 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 369 224.64 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 34.2 224.64 \n",
       "L 369 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 34.2 7.2 \n",
       "L 369 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p5359449fbc\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"34.2\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "all_family_user = data.groupby('家属数量')['好坏客户'].count()\n",
    "bad_family_user = data.groupby('家属数量')['好坏客户'].sum()\n",
    "bad_rate = bad_family_user / all_family_user\n",
    "bad_rate\n",
    "bad_rate.plot()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
